npm install failed at the nodemon#1.18.9 postinstall script - node.js

the commands 'npm install' gives me the following error:
> nodemon#1.18.9 postinstall C:\Users\Nikhil\Music\tab-tracker\server\node_modules\nodemon
> node bin/postinstall || exit 0
npm WARN server#1.0.0 No description
npm WARN server#1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! file bashcls
npm ERR! path bashcls
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn bashcls
npm ERR! nodemon#1.18.9 postinstall: `node bin/postinstall || exit 0`
npm ERR! spawn bashcls ENOENT
npm ERR!
npm ERR! Failed at the nodemon#1.18.9 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Nikhil\AppData\Roaming\npm-cache\_logs\2018-12-16T19_09_40_364Z-debug.log
As can be seen from the error messages, npm install fails at nodemon#1.18.9 postinstall script.
I've tried things like, deleting the node_modules folder and re-running the 'npm install' command again, the same error appears.
Also, i tried cleaning the npm cache as suggested by this answer, and it didn't work. Trying to separtely install nodemon gives the same error as above.

I have the same problem while I installing
nodemon
in devDependencies for my existing projects in different computer.
I do a research and found a solution that helped me to solved this kind for problem. It's happening because of security issues depending on your OS.
Solve this by :
npm install -g nodemon --unsafe-perm=true --allow-root
PS :
This too can happen in Electron also, so u can solve by -
npm install -g electron --unsafe-perm=true --allow-root

Related

I can't install npm or node js in my git bash folder named phaser3-project-template

whenever I type npm install in my git bash terminal there is an error that says
> uglifyjs-webpack-plugin#0.4.6 postinstall C:\Users\Bea Beangca\Desktop\phaser\phaser3-project-template\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js
'node' is not recognized as an internal or external command,
operable program or batch file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! uglifyjs-webpack-plugin#0.4.6 postinstall: `node lib/post_install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the uglifyjs-webpack-plugin#0.4.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bea Beangca\AppData\Roaming\npm-cache\_logs\2021-09-08T06_30_15_228Z-debug.log
And when I type ls in my git bash terminal, it will show that I downloaded node_modules
$ ls
LICENSE README.md assets/ build/ index.html node_modules/ package-lock.json package.json src/ webpack.config.js
$ npm run start
> phaser3-project-template#1.0.9 start C:\Users\Bea Beangca\Desktop\phaser\phaser3-project-template
> npm run build && webpack-dev-server --port=8000
'npm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phaser3-project-template#1.0.9 start: `npm run build && webpack-dev-server --port=8000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phaser3-project-template#1.0.9 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Bea Beangca\AppData\Roaming\npm-cache\_logs\2021-09-08T06_34_12_381Z-debug.log
It looks like your git bash doesn't have node installed. I only think that because it says npm is not recognized as an internal or external command
If I'm correct I believe your solution would be to install either nvm or nodejs. Are you using Windows?

unable to install and run nodemon npm - Nodejs

i am unable to run my nodejs project , getting the below error.
> restfullnodejs#1.0.0 start C:\Users\PC\restfullnodejs
> nodemon app.js
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! file C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! path C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! errno ENOENT
npm ERR! restfullnodejs#1.0.0 start: `nodemon app.js`
npm ERR! spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe ENOENT
npm ERR!
npm ERR! Failed at the restfullnodejs#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PC\AppData\Roaming\npm-cache\_logs\2020-07-01T13_04_14_121Z-debug.log
My guess is the error with nodemon , if so how do i resolve this issue . Unable to install nodemon too
Update
After deleting package-lock.json file and nodemodules folder tried npm clear cache --force then npm install - g nodemon
then getting below error
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#~2.1.2 (node_modules\nodemon\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! file C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! path C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! errno ENOENT
npm ERR! nodemon#2.0.4 postinstall: `node bin/postinstall || exit 0`
npm ERR! spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe ENOENT
npm ERR!
npm ERR! Failed at the nodemon#2.0.4 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PC\AppData\Roaming\npm-cache\_logs\2020-07-01T14_10_55_492Z-debug.log
This is a common issue on PC/Windows;
Try:
Deleting the package-lock.json, and node_modules folder.
Run 'npm install' from the root folder for your app.
Run 'npm install -g nodemon'

npm npm run watch-poll error for homestead

I am trying to use npm for a project I am working on in Homestead however I am getting some errors.
I ran
npm run watch-poll
but I get this error
vagrant#homestead:~/code/testlaravel$ npm run watch-poll
> # watch-poll /home/vagrant/code/testlaravel
> npm run watch -- --watch-poll
> # watch /home/vagrant/code/testlaravel
> npm run development -- --watch "--watch-poll"
> # development /home/vagrant/code/testlaravel
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress
--hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll"
sh: 1: cross-env: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! # development: "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch" "--watch-poll""
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the # development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-02-18T14_11_57_194Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: "npm run development -- --watch "--watch-poll""
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-02-18T14_11_57_246Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch-poll: "npm run watch -- --watch-poll"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch-poll script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-02-18T14_11_57_290Z-debug.log
I'm new to npm and I have no idea what to do and I have not found anyone online with a similar problem.
npm version = 6.7.0
node version = v10.15.1
If you need it.
I would appreciate any help, also if you need anymore info about what i'm running and how things are set up let me know.
edit 1
running
npm install
gives this result
vagrant#homestead:~/code/testlaravel$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist#1.2.0 (node_modules/fsevents/node_modules/rc/node_modules/minimist):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, open '/home/vagrant/code/testlaravel/node_modules/fsevents/node_modules/rc/node_modules/minimist/package.json.3101396508'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
audited 11757 packages in 87.877s
found 2 vulnerabilities (1 low, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
edit 2
Ok so I ran
sudo npm i -g cross-env
because I got a permissions error without the sudo bit, and it looks like it worked.
However I am getting a new error now
ERROR Failed to compile with 2 errors 3:18:10 PM
error in ./resources/assets/sass/app.scss
error in ./resources/assets/sass/app.scss
I guess this is a problem with the my code/framework (i'm using laravel) but yes sudo npm i -g cross-env looks like it fixed it.
You have missing module cross-env. Run:
npm i -g cross-env
to install cross-env globally.

Erron on installing angular on mac

I try to install Angular CLI on mac with following command
sudo npm install -g #angular/cli
The error shown as follows
/usr/local/bin/ng -> /usr/local/lib/node_modules/#angular/cli/bin/ng
> fsevents#1.2.4 install /usr/local/lib/node_modules/#angular/cli/node_modules/fsevents
> node install
sh: node: command not found
> #angular/cli#6.0.8 postinstall /usr/local/lib/node_modules/#angular/cli
> node ./bin/ng-update-message.js
sh: node: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/#angular/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! #angular/cli#6.0.8 postinstall: `node ./bin/ng-update-message.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the #angular/cli#6.0.8 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sugunan/.npm/_logs/2018-07-08T01_27_53_465Z-debug.log
How to fix the issue?
Following command worked
sudo npm install -g #angular/cli --unsafe-perm=true --allow-root

Installing nodejs giving me an error - for Ethereum [duplicate]

This question already has answers here:
Cannot install packages using node package manager in Ubuntu
(19 answers)
Closed 5 years ago.
I am trying to install nodejs based on a video that I am watching (installing Ethereum) and I am getting an error. I also tried using (sudo -i) but it is still giving me an error - see below.
Any help would be appreciated.
npm install -g ethereumjs-testrpc
/usr/local/bin/testrpc -> /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js
fsevents#1.1.3 install /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/fsevents
node install
sh: node: command not found
uglifyjs-webpack-plugin#0.4.6 postinstall /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js
sh: node: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules/ethereumjs-testrpc/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! uglifyjs-webpack-plugin#0.4.6 postinstall: `node lib/post_install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the uglifyjs-webpack-plugin#0.4.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Node.js
sudo apt-get update
sudo apt-get install nodejs
npm
sudo apt-get install npm

Resources