I run the following command in my terminal:
npm install -g nodemon
but whenever i starting nodemon by nodemon index.js , it's showing me the following error:
nodemon : File C:\Users\****\****\Roaming\npm\nodemon.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
nodemon index.js
CategoryInfo : SecurityError: (:) [], PSSecurityException
FullyQualifiedErrorId : UnauthorizedAccess
>
My package.json file is:
{
"name": "gfg-express",
"version": "1.0.0",
"description": "How to connect express with mongodb atlas",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Greyhat07",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
}
solution, that is how to solve this problem
Related
I'm using parcel-bundler for sass on my projects, I've always used npm start instead of npm run build and it has always worked for me. But this time, when I try to deploy my project on vercel, it failed and it says "Error: Command "npm run build" exited with 127"?
[19:25:23.101] Cloning github.com/sn-tin/odin-etch-a-sketch (Branch: main, Commit: e5ff000)
[19:25:23.584] Cloning completed: 482.734ms
[19:25:23.676] Installing build runtime...
[19:25:25.452] Build runtime installed: 1.775s
[19:25:26.373] No Build Cache available
[19:25:26.541] Installing dependencies...
[19:25:27.829]
[19:25:27.830] added 17 packages in 1s
[19:25:27.830]
[19:25:27.830] 2 packages are looking for funding
[19:25:27.830] run `npm fund` for details
[19:25:28.030] Detected `package-lock.json` generated by npm 7...
[19:25:28.031] Running "npm run build"
[19:25:28.305]
[19:25:28.306] > odin-eas#1.0.0 build
[19:25:28.306] > parcel build src/index.html
[19:25:28.306]
[19:25:28.322] Error: Command "npm run build" exited with 127
My package.json
{
"name": "odin-eas",
"version": "1.0.0",
"description": "",
"main": "index.js",
"target": {
"main": false
},
"scripts": {
"start": "parcel src/index.html",
"build": "parcel build src/index.html"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"#parcel/transformer-sass": "^2.5.0",
"bundler": "^0.8.0",
"parcel": "^2.5.0",
"sass": "^1.51.0"
}
}
I'm running my first test using percy snapshot using the following command
npm run test:percy
. I got the following error message:
xxx.xxx#LPG002572 TC-Visual % npm run test:percy
npm ERR! missing script: test:percy
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxx.xxx/.npm/_logs/2020-04-06T16_11_45_122Z-debug.log
jacqueline.george#LPG002572 TC-Visual % npm run test:percy
npm ERR! missing script: test:percy
However my package.json which I double checked seems to be correct. What did I do wrong, and how do I fix it?
{
"name": "tc-visual",
"version": "1.0.0",
"description": "Visual testing with TestCafe and Percy.io",
"main": "index.js",
"scripts": {
"test": "percy exec -- testcafe chrome ./tests"
},
"keywords": [
"TestCafe",
"percy"
],
"author": "xxx xxx",
"license": "ISC",
"dependencies": {
"#percy/testcafe": "^0.2.0",
"testcafe": "^1.8.3"
}
}
The root cause of this problem is that under 'tests' in the package Json. I made an omission. This is very easy to do. So if anyone else is experiencing this issue please be careful because when you modify your package json. As you can see in the updated code I added test:percy
Please see the updated package json with the correct information
{
"name": "tc-visual",
"version": "1.0.0",
"description": "Visual testing with TestCafe and Percy.io",
"main": "index.js",
"scripts": {
"test:percy": "percy exec -- testcafe chrome ./tests"
},
"keywords": [
"TestCafe",
"Percy"
],
"author": "Author",
"license": "ISC",
"dependencies": {
"#percy/testcafe": "^0.2.0",
"testcafe": "^1.8.3"
}
}
This worked for me.
$ percy exec -- testcafe chrome ./tests
'percy' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1
.
yarn add percy or npm install percy
Also percy client was needed after getting this error: Unsupported Percy CLI version, disabling snapshots.
npm install --save-dev #percy/cli
I cannot figure out how to update a dependent package included in Botkit. After running npm install on the package.json below. Npm warns that the hoek package is vulnerable. I've tried running npm audit fix with no resolution. When I run npm ls hoek it shows botkit installed hoek#2.16.3. I don't see why it would install an out of date version.
//package.json
{
"name": "deleteme",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"botkit": "^0.6.16"
}
}
From the npm documentation:
As of npm#2.6.1, the npm update will only inspect top-level packages.
Prior versions of npm would also recursively inspect all dependencies.
To get the old behavior, use npm --depth 9999 update.
See more details here: https://docs.npmjs.com/cli/update
I wanted to setup webpack and babel with npm, but I got this error
npm ERR! Unexpected end of JSON input while parsing near '...pdragon":"^0.7.0","to' npm ERR! A complete log of this run can be found in:
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\luchan.vladyslav\AppData\Roaming\npm-cache\_logs\2017-12-10T10_48_56_298Z-debug.log
here is my package.json
{
"name": "ddd",
"version": "1.0.0",
"description": "components",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1"
}
}
At the begining I have tried to install webpack webpack-dev-server babel-core babel-loader and babel-preset-env in one line. But I got this error, after a while I figured out that problem is related to webpack and wepback-dev-server
screenshot
Looks like the corrupt local node_modules is to be blamed. Can you remove the local node_modules folder and then freshly install by `npm install' ? That should fix the issue.
To solve this problem you should clean your cache with
npm cache clean --force
That will solve the problem
My package.json file for the server folder I'm trying to start:
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon src/app.js --exec 'npm run lint && node'",
"lint": "./node_modules/.bin/eslint **/*.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"eslint": "^4.12.0",
"nodemon": "^1.12.1"
}
}
I do not know why it doesn't notice npm from the package.json start script when npm runs perfectly when it's not being executed through package.json.
Anyone know why? I'm trying to learn Full Stack development and I am confused on this error.
Edit: I'm running Windows 10.
Use double quotes in your script as single quotes won't recognize in Windows command line.
Change your start to:
"start": "nodemon src/app.js --exec \"npm run lint && node\"",