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
Related
I using from this command "nvm install node" and then nvm use 11, but get me bellow error:
npm ERR! notsup Required: {"node":">=14.15.0 <15"}
npm ERR! notsup Actual: {"npm":"6.7.0","node":"11.15.0"}
But I need just to use nvm use 11, what can I do? (witch version of npm?)
My system is Mac.
My error is:
> npm install && npx cordova prepare && npx gulp
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for moodlemobile#3.9.6-dev: wanted: {"node":">=14.15.0 <15"} (current: {"node":"11.15.0","npm":"6.7.0"})
npm ERR! notsup Not compatible with your version of node/npm: moodlemobile#3.9.6-dev
npm ERR! notsup Not compatible with your version of node/npm: moodlemobile#3.9.6-dev
npm ERR! notsup Required: {"node":">=14.15.0 <15"}
npm ERR! notsup Actual: {"npm":"6.7.0","node":"11.15.0"}
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/asheq/.npm/_logs/2021-09-02T04_50_08_043Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! moodlemobile#3.9.6-dev setup: `npm install && npx cordova prepare && npx gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the moodlemobile#3.9.6-dev setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/asheq/.npm/_logs/2021-09-02T04_50_08_060Z-debug.log
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'
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
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
I am unable to install yo from npm I have found these errors while running installation of yo, I have made all the paths for environment variables, but still getting error, i have also cleared the cache and re-install the nodejs , reboot my pc but still getting this error
$ npm install --global yo
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
C:\Users\hp\AppData\Roaming\npm\yo -> C:\Users\hp\AppData\Roaming\npm\node_modules\yo\lib\cli.js
C:\Users\hp\AppData\Roaming\npm\yo-complete -> C:\Users\hp\AppData\Roaming\npm\node_modules\yo\lib\completion\index.js
spawn-sync#1.0.15 postinstall C:\Users\hp\AppData\Roaming\npm\node_modules\yo\node_modules\spawn-sync
node postinstall
npm#1.0.0 C:\Users\hp\AppData\Roaming\npm
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync#1.0.15 (node_modules\yo\node_modules\spawn-sync):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync#1.0.15 postinstall: node postinstall
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status -4058
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--global" "yo"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! file ;C:\Program Files\Git\bin;C:\Program Files\Git\cmd
npm ERR! path ;C:\Program Files\Git\bin;C:\Program Files\Git\cmd
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn ;C:\Program Files\Git\bin;C:\Program Files\Git\cmd
npm ERR! spawn-sync#1.0.15 postinstall: node postinstall
npm ERR! spawn ;C:\Program Files\Git\bin;C:\Program Files\Git\cmd ENOENT
npm ERR!
npm ERR! Failed at the spawn-sync#1.0.15 postinstall script 'node postinstall'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs spawn-sync
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.
npm#1.0.0 C:\Users\hp\AppData\Roaming\npm
`-- (empty)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync#1.0.15 (node_modules\yo\node_modules\spawn-sync):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn-sync#1.0.15 postinstall: node postinstall
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status -4058
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--global" "yo"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! Callback called more than once.
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\hp\npm-debug.log
npm ERR! code 1
Please tell me what is the problem with it.
Just install the latest version of nodejs and the error will get resolved.
Type the instructions in the terminal and node js will get updated:
$ sudo apt purge nodejs (for removing previous files of node js)
$ wget -qO- https://deb.nodesource.com/setup_7.x | sudo bash -(it will download latest version of node)
$ sudo apt-get install nodejs
and it is done.
Happened to me too... in recent distributions many packages install nodejs as the node.js executable, while spawn-sync attempts to call node, that is why this fails.
As a workaround, you can create a softlink from node to nodejs. Something like:
sudo ln -s `which nodejs` /usr/bin/node