Error:
Every time I try to install some module using npm I get this output log in console:
1:C:\Windows\system32>npm install -g serialport
2:"CALL "C:\Users\<user>\Documents\nodejs\\node.exe"
3:"C:\Users\<user>\Documents\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g" is not recognized as an
4:internal or external command,
5:programa o archivo por lotes ejecutable.
6:npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible --
7:are you offline?
8:npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during
9:revalidation.
10:
11:> #serialport/bindings#8.0.6 install
12:C:\Users\<user>\AppData\Roaming\npm\node_modules\serialport\node_modules\#serialport\bindings
13:> prebuild-install --tag-prefix #serialport/bindings# || node-gyp rebuild
14:
15:npm ERR! code ELIFECYCLE
16:npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\Python34;
17:npm ERR! file C:\Windows\system32\cmd.exe;C:\Python34;
18:npm ERR! path C:\Windows\system32\cmd.exe;C:\Python34;
19:npm ERR! errno -4058
20:npm ERR! #serialport/bindings#8.0.6 install: `prebuild-install --tag-prefix #serialport/bindings# ||
21:node-gyp rebuild`
22:npm ERR! spawn C:\Windows\system32\cmd.exe;C:\Python34; ENOENT
23:npm ERR!
24:npm ERR! Failed at the #serialport/bindings#8.0.6 install script.
25:npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
26:
27:npm ERR! A complete log of this run can be found in:
28:npm ERR! C:\Users\<user>\AppData\Roaming\npm-cache\_logs\2020-01-25T14_44_28_892Z-debug.log
(Note that the line enumeration in this output was hand made and doesn't correspond with the actual output lines. It's just for pointing out things better)
Hightlights:
npm ERR! code ELIFECYCLE
npm ERR! errno -4058
npm ERR! Failed at the #serialport/bindings#8.0.6 install script.
This error pops specifically when I try to run the command npm install -g <module> or even just npm install <module> for when I want to do it locally.
Also
The output log that you can see between the lines 2 and 4 is something that I get every time I try to run a npm command, independently if it is "npm install " or any other.
Example:
C:\Windows\system32>npm -v
"CALL "C:\Users\<user>\Documents\nodejs\\node.exe" "C:\Users\<user>\Documents\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g" npm' is not recognized as an internal or external command, operable program, or batch file.
6.13.6
As you can see in this and the previous example: even though I get this error message, the command is executed anyways in after said error.
Extra info
I have installed Node.js in custom location C:\Users\<user>\Documents\nodejs instead of C:\Program Files\nodejs
I have never faced this issue when I installed Node.js before in this computer.
NPM cache log: https://drive.google.com/file/d/1DOd4uYVjn_ko3ZWZOM8ceavx8w_yYSWY/view?usp=sharing
OS:----------- Windows 10
Node.js:----- v13.7.0
NPM: --------- v6.13.6
Related
I'm updating a 3 years ago ruby on rails and react project trying to npm install but im stuck here getting this error
$ npm install
gyp: Undefined variable standalone_static_library in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
$ npm start
sh: node-sass-chokidar: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! frontend#0.1.0 build-css: `node-sass-chokidar src/styles -o src/styles`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the frontend#0.1.0 build-css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I tried removing node_modules, update node version and npm version.
For me this issue happened with NodeJS 19 (specifically 19.2.0)
The issue is fixed when I reverted to NodeJS 18; aka NodeJS LTS
NodeJS LTS = Long Term Support; "recommended for most users" - which at the time of this writing (12/9/2022) is NodeJS 18.12.1
It seems like this issue (Undefined variable standalone_static_library...) may happen because:
node 19.0.0 has been changed to make process.config read only #43627
After reverting, it may still be mentioned as a warning, but not an error:
npm ERR! (node:7120) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
And while we're talking about versions, be careful about Python3 vs Python2!
npm ERR! gyp verb which failed Error: not found: python2
I keep getting these errors. Recently developed a simple web app and posted on my repository and kept getting these errors thereafter.
npm ERR! code ELIFECYCLE – David 1 hour ago
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\Users'username'\AppData\Local\GitHub\PortableGit_'numbersandletters'\cmd\git.exe; C:\Program Files\nodejs
npm ERR! file C:\Windows\system32\cmd.exe;C:\Users'username'\AppData\Local\GitHub\PortableGit_'numbersandletters'\cmd\git.exe; C:\Program Files\nodejs
npm ERR! path C:\Windows\system32\cmd.exe;C:\Users'username'\AppData\Local\GitHub\PortableGit_'numbersandletters'\cmd\git.exe; C:\Program Files\nodejs
npm ERR! errno -4058 npm ERR! robofriends#0.1.0 start: react-scripts start
pm ERR! spawn C:\Windows\system32\cmd.exe;C:\Users'username'\AppData\Local\GitHub\PortableGit_'numbersandletters'\cmd\git.exe; C:\Program Files\nodejs ENOENT npm ERR! npm ERR! Failed at the robofriends#0.1.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\hp\AppData\Roaming\npm-cache_logs\2021-01-09T03_19_55_548Z-debug.log C:\Users\hp\Desktop\David\robofriends>
i kept getting erros even after deleting the node modules and package.json, i uninstalled node and installed again, ran npm innit to get my package.json and i got this error
'CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,
operable program or batch file.
ENOENT means no such file or directory, meaning something being referenced by some process doesn't exist where the process thought it did, such as the node executable, cmd.exe, or the react-scripts executable in node_modules. In this case it seems to be a Windows-specific issue. Adding cmd.exe to your path may fix things. See this question for more.
'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bookbhandar#0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bookbhandar#0.1.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\Laxman\AppData\Roaming\npm-cache_logs\2020-08-22T18_25_37_539Z-debug.log
Can some one help me with this error?
It seems like react-scripts is not installed into your node_modules folder. Try to check if you are running the command on the correct folder and if the react-scripts dependency is in the package.json file.
Otherwise try to delete the node_modules folder and run npm i.
Windows 10
node v8.9.2
npm 5.5.1
installed vue-cli through the use of npm but entering 'npm run dev' resulted in an error.
this is error message
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webpack-simple#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webpack-simple#1.0.0 dev 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\hansol\AppData\Roaming\npm-cache\_logs\2017-12-08T04_14_50_859Z-debug.log
It appears as though you havent installed the node modules / dependencies.
Please try and run a
npm install
And see if that works
I used to face this problem when the port is busy.
So confirm the port you are opening for the dev server.
you can also change the port using a flag "--port 3000".
I am using Windows 7 64bit, trying to install bson as a dependencie of mongodb.
I get this error:
npm WARN package.json Wochenplaner#0.0.1 No README.md file found!
npm http GET https://registry.npmjs.org/bson
npm http 304 https://registry.npmjs.org/bson
bson#0.1.5 install C:\Users\Administrator\Dropbox\Projekte\Wochenplaner\node_m
odules\bson
node install.js || (exit 0)
CreateProcessW: Das System kann die angegebene Datei nicht finden.
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\Users\Administrator\Drop
box\Projekte\Wochenplaner\node_modules\bson'
npm ERR! error rolling back bson#0.1.5 { [Error: ENOTEMPTY, rmdir 'C:\Users\Adm
inistrator\Dropbox\Projekte\Wochenplaner\node_modules\bson']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'C:\Users\Administrator\Dropbox\Projekte
\Wochenplaner\node_modules\bson' }
npm ERR! bson#0.1.5 install: node install.js || (exit 0)
npm ERR! cmd "/c" "node install.js || (exit 0)" failed with 127
npm ERR!
npm ERR! Failed at the bson#0.1.5 install script.
npm ERR! This is most likely a problem with the bson package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js || (exit 0)
npm ERR! You can get their info via:
npm ERR! npm owner ls bson
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "bson"
npm ERR! cwd C:\Users\Administrator\Dropbox\Projekte\Wochenplaner
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\Administrator\Dropbox\Projekte\Wochenplaner\npm-debug.log
npm ERR! not ok code 0
I get this log: http://pastebin.com/B6F2C5um
What is the problem?
Also: I tried to install versions 0.1.1, 0.1.2, 0.1.3 etc.
I was having the same exact issue and remembered I had fiddled with my PATH variable, recently. It was failing to run cmd.exe.
It was fixed after adding c:\windows\system32 to my PATH.
Per below (note the node issue mentions socket.io, which was also causing similar problems when I tested it):
https://github.com/joyent/node/issues/4222
Try deleting C:\Users\Administrator\Drop
box\Projekte\Wochenplaner\node_modules and reinstalling.
I just installed the bson package on my Win7 (64bit also) box without any issues.
Check the following points.
Is your node executable accessible from everywhere? (check with opening a command line and just type node + Enter, if a shell pops up you should be fine)
Do you have sufficent access rights for the target folder in question?
Since the main error seems to be CreateProcessW: Das System kann die angegebene Datei nicht finden., i'm pretty sure the first point is the issue.
You could fix that easily by either re-installing node.js or adding the path to your node executable manually to the PATH environment variable.