unable to install and run nodemon npm - Nodejs - node.js

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'

Related

Getting prebuild-install || node-gyp rebuild while installing couchbase#2.5.1

System
Version - couchbase in package.json
"couchbase": "2.5.1"
I am getting the below error while doing npm i
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! couchbase#2.5.1 install: `prebuild-install || node-gyp rebuild`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the couchbase#2.5.1 install 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/rahul/.npm/_logs/2022-04-19T04_32_43_715Z-debug.log
Tried to install node-gyp
npm install -g node-
Went through https://forums.couchbase.com/t/npm-install-couchbase-failure/17978
But this also didn’t work.

Npm not being able to find a file - Installing bcrypt

I'm having an issue with installing Bcrypt via NPM.
Installing it using the command npm install bcrypt gives the following:
npm WARN lifecycle npm is using /opt/plesk/node/7/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> bcrypt#3.0.6 install /var/www/vhosts/mydomain/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
/usr/bin/env: node: No such file or directory
npm WARN enoent ENOENT: no such file or directory, open '/var/www/vhosts/mydomain/package.json'
npm WARN mydomain No description
npm WARN mydomain No repository field.
npm WARN mydomain No README data
npm WARN mydomain No license field.
npm ERR! Linux 3.10.0-042stab140.1
npm ERR! argv "/opt/plesk/node/7/bin/node" "/opt/plesk/node/7/bin/npm" "install" "bcrypt"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! bcrypt#3.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the bcrypt#3.0.6 install script 'node-pre-gyp install --fallback-to-build'.
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 bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
I have run npm bugs bcrypt and my server has also spit out the following:
npm ERR! Linux 3.10.0-042stab140.1
npm ERR! argv "/opt/plesk/node/7/bin/node" "/opt/plesk/node/7/bin/npm" "bugs" "bcrypt"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! path xdg-open
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn xdg-open
npm ERR! enoent spawn xdg-open ENOENT
npm ERR! enoent spawn xdg-open ENOENT
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
Any ideas as to what's going on? Is there a compatibility issue to the version of NPM or Node that I'm running?
Any help is appreciated :)
Cheers

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

'npm install' throws error on remote host 'cannot read property 'length' of undefined'

I am trying to deploy my local development to GitHub and also let my Webserver pull from Github (which works fine).
I clone my Laravel Repository from Github to my Server. After that I run composer install (which works fine).
But when running npm install I get the following error:
npm ERR! Cannot read property 'length' of undefined
npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2017-11-12T14_48_59_351Z-debug.log
I checked the log file: it is empty.
Further, running other commands like npm help config throws this error:
npm ERR! file man
npm ERR! path man
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn man
npm ERR! enoent spawn man ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! enoent Check if the file 'man' is present.
npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2017-11-12T14_49_57_777Z-debug.log
I just installed node and npm on my shared hosting via the command line.
npm -v results in 5.5.1
Any ideas how to solve this? Could this be an error within NPM?
EDIT
I tried several other node & npm versions and with node.js v7.10.1 and npm 4.2.0 at least npm install starts running. It then produces the following error (which brings me to the conclusion that I need a newser version of npm, but the newer versions throw the errors mentioned above):
└── vuejs-datepicker#0.9.19
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-98-generic
npm ERR! argv "node" "/node-v7.10.1-linux-x64/bin/npm" "install"
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mozjpeg#4.1.1 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mozjpeg#4.1.1 postinstall script 'node lib/install.js'.
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 mozjpeg package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node lib/install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mozjpeg
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mozjpeg
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /.npm/_logs/2017-11-12T15_23_08_709Z-debug.log
Any way I could come around this issue without installing a new npm version? That might help me, too. I am very grateful for any help.
Thank you!

Error when doing npm install [Angular 2]

Hello all I am getting the following error when doing npm install I have reinstalled my nodejs also but that is not working, I am not behind the firewall
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#
1.0.17: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"
})
npm WARN angular2-quickstart#1.0.0 No description
npm WARN angular2-quickstart#1.0.0 No repository field.
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Satish Kumar\\Ap
pData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.9.5
npm ERR! npm v4.1.2
npm ERR! path C:\Users\Satish Kumar\Desktop\angular2-course-master\node_modules\
.staging\invert-kv-e1d023cb\package.json.143624776
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Satish Kumar\De
sktop\angular2-course-master\node_modules\.staging\invert-kv-e1d023cb\package.js
on.143624776' -> 'C:\Users\Satish Kumar\Desktop\angular2-course-master\node_modu
les\.staging\invert-kv-e1d023cb\package.json'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\Satish Kumar
\Desktop\angular2-course-master\node_modules\.staging\invert-kv-e1d023cb\package
.json.143624776' -> 'C:\Users\Satish Kumar\Desktop\angular2-course-master\node_m
odules\.staging\invert-kv-e1d023cb\package.json'
npm ERR! at Error (native)
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\Satish Kumar\\Desktop\\angular2-course-master\\node
_modules\\.staging\\invert-kv-e1d023cb\\package.json.143624776',
npm ERR! dest: 'C:\\Users\\Satish Kumar\\Desktop\\angular2-course-master\\node
_modules\\.staging\\invert-kv-e1d023cb\\package.json',
npm ERR! parent: 'angular2-quickstart' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Satish Kumar\Desktop\angular2-course-master\npm-debug.log
Somehow I fixed the above error by running the npm install in admin mode
but, now when doing npm start I am getting the error listed below please help
C:\Users\Satish Kumar\Desktop\angular2-course-master>npm start
> angular2-quickstart#1.0.0 start C:\Users\Satish Kumar\Desktop\angular2-course-
master
> tsc && concurrently "npm run tsc:w" "npm run lite"
app/posts/posts.component.ts(6,20): error TS2307: Cannot find module 'underscore
'.
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Satish Kumar\\Ap
pData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.5
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart#1.0.0 start: `tsc && concurrently "npm run tsc:w" "
npm run lite" `
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular2-quickstart#1.0.0 start script 'tsc && concurrent
ly "npm run tsc:w" "npm run lite" '.
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 angular2-quickstart p
ackage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc && concurrently "npm run tsc:w" "npm run lite"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Satish Kumar\Desktop\angular2-course-master\npm-debug.log

Resources