npm install fails with npm.cmd: command not found - linux

We currently do sudo npm i instead of npm i to circumvent this issue. Our Ubuntu team members can't do this however because nvm isn't installed for root. NVM and N both have this same issue.
geoyws-mbp:ifca-construction-react geoyws$ npm i
> ifca-construction-react#0.1.0 prepare /Users/geoyws/work/src/ifca/ifca-react/src/modules/ifca-construction-react
> npm.cmd run compile
sh: npm.cmd: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! ifca-construction-react#0.1.0 prepare: `npm.cmd run compile`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the ifca-construction-react#0.1.0 prepare 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/geoyws/.npm/_logs/2019-10-03T09_40_46_545Z-debug.log

The problem was that one of our engineers changed our npm start script from npm run compile to npm.cmd run compile in our package.json. Either that or create-react-app did that, which is very unwise because people work with various OSes on the same codebase.

Related

Node Gui installation can't find Cmake

I'm trying to install nodegui following their docs, but seems it can't find Cmake even if I already installed it (and visual studio 2019 too). This is the error:
> cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile
[
'C:\\Program Files\\nodejs\\node.exe',
'C:\\Users\\giova\\Coding projects\\Node_Gui\\Tutorial_1\\nodegui-starter\\node_modules\\cmake-js\\bin\\cmake-js',
'compile'
]
ERR! OMG CMake is not installed. Install CMake.
ERR! OMG CMake is not installed. Install CMake.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #nodegui/nodegui#0.36.0 build:addon: `cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #nodegui/nodegui#0.36.0 build:addon 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! C:\Users\giova\AppData\Roaming\npm-cache\_logs\2021-10-15T06_47_38_675Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #nodegui/nodegui#0.36.0 postinstall: `cross-env npm run setupqt && (node ./scripts/skip.js || npm run build:addon)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #nodegui/nodegui#0.36.0 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\giova\AppData\Roaming\npm-cache\_logs\2021-10-15T06_47_39_666Z-debug.log
I think I solved the issue by adding C:\Program Files\CMake\bin to the PATH enviroment variable, like here: https://www.youtube.com/watch?v=8_X5Iq9niDE.
I'm not 100% sure this is the actual solution because I tried random things before that, but probably it's the right way.
I had the same problem, and installed this package globally: https://www.npmjs.com/package/cmake-js
npm i -g cmake-js
npm i on the NodeGui install
This got me beyond the cmake problem.

NPM fails with the code: npm ERR! code ELIFECYCLE

I am fairly new to node and javascript. I am trying to run this on my localhost
https://github.com/bitpay/wallet
originally I was using node.js v14 but I was getting an error. I did some research and found that I should downgrade to node.js v11.
After doing so I get an error after trying to run npm install.
'rm' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! copay#12.1.1 env:dev: `rm -f src/environments/index.ts && cp src/environments/dev.ts src/environments/index.ts
npm ERR!
npm ERR! # Environment set to: dev
npm ERR!
npm ERR! `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the copay#12.1.1 env: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\Jacob\AppData\Roaming\npm-cache\_logs\2021-03-01T19_15_48_533Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! copay#12.1.1 postinstall: `npm run env:dev && npm run prompt && npm run patch:bwc && npm run patch:walletconnec
t`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the copay#12.1.1 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\Jacob\AppData\Roaming\npm-cache\_logs\2021-03-01T19_15_48_594Z-debug.log
I'm not sure exactly what to do to fix this. I've read other posts and tried to do what they suggest. I deleted the node_modules file and clear the cache but I am still getting the same error. I've noticed it's saying 'rm' is not recognized as an internal or external command. I've tried to change it to del instead of rm but that doesn't seem to help either. Any suggestions on how to get this to work on my localhost?
this is the first line from the log your shared indicating what is the error
'rm' is not recognized as an internal or external command,
it happens since (as you mentioned) you are running windows and i assume you are running npm under cmd or powershell, which does not have rm command natively.
i would suggest your to switch to windows subsystem for linux, which should have system command like rm and see whether it solves your issue.

Issue with Global Install of Ngrok in MacOS and Arch Linux with NPM

Issue that I am facing:
I am trying to install ngrok globally on my MacOS. But when I install it gives me this:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ngrok#3.2.5 postinstall: `node ./postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngrok#3.2.5 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/careaxiom/.npm/_logs/2019-10-23T10_16_49_550Z-debug.log
same with sudo
Its kind of in discussion on gitHub whats causing it but this works just fine for now
sudo npm install -g ngrok --unsafe-perm=true --allow-root

Npm start gives the error

everyone!
I am trying to run default task on npm run command on Windows 10.
That is an error that I have got while using it.
npm ERR! code ELIFECYCLE
npm ERR! errno 9
npm ERR! builderLight#0.0.15 start: `bower install && gulp --debug`
npm ERR! Exit status 9
npm ERR!
npm ERR! Failed at the builderLight#0.0.15 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\User\AppData\Roaming\npm-cache\_logs\2018-04-29T15_01_45_882Z-debug.log
How to fix this bug?
You simply have to run first: npm install or bower install

npm start doesn't work after i do npm unlink

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/myName/.nvm/versions/node/v5.12.0/bin/node" "/Users/myName/.nvm/versions/node/v5.12.0/bin/npm" "start"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! appName#1.5.1 start: `ember server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appName start script 'ember server'.
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 appName package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ember server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs appName
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls appName
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/myName/Documents/Dev/ember-project-name/npm-debug
I linked gooey, one of my projects, to another project: ember, now i wanted to unlink them
so i did npm unlink
then npm start didn't work no matter what i did.
things I've tried:
npm install several times,
bower install several times,
rm -rf node_modules
rm -rf bower_components
npm install several times
npm start kept giving errors, like can't find some file in gooey or tell author that ember server failed
The solution:
option 1:
first do npm link so that it installs everything it needs
then npm install, then npm start will start working again.
option2:
if you want to unlink, do:
npm unlink
npm update
npm start
that should work too.
try npm install again before npm start if you have problems.

Resources