I installed node js using nvm first I installed version 17.1.0 I had some problems with node-gyp , so I downgraded to 16.3.0 (current lts) .
but every script I am runing using npx causeing me an error
spawn <package npx need to run> ENOENT
If I am installing the package globaly it will work only in the same terminal session
I understand this may not be the best solution but I have been having problems with nvm and versions not actually switching So I would start by looking at your current node version
node -v
And check your npx version with
npx -v
Anything above node 5.2 should have npx already installed but on the off chance that it isn't you can install it with
npm install -g npx
If this is all installed, theoretically it should all work but I understand you are having issues. This is not an ideal solution, but you could
npm i <package-name>
npm run <package-name>
Hopefully this at least allows you to continue working while finding out why npx isn't working on your machine.
Another npm version manager alternative is n if you'd like to check them out and see if you have any better luck installing and changing node versions
https://www.npmjs.com/package/n
OK so, I went to the nodejs.org webpage, downloaded node version 7.5.0, installed it using the easy to use wizard.
It installed with no errors or issues.
When I open up my terminal, node -v gives me v7.5.0, and npm -v gives me 3.6.0.
Obviously I want the latest version of npm, so I go to npm install npm#latest -g, but I get this error:
Cannot find module 'internal/fs'
In fact, trying to install ANYTHING using npm results in the same error.
How do I fix npm?
Try uninstalling your current node version and reinstall using nvm or brew:
To find where node lives: command -v node && command -v npm
Remove these directories as stated in some of the comments here: https://github.com/nodejs/node/issues/9377
Posting this for anyone passing by. You can use npm up -g to update the npm version. Here's output from my console installing node 4.7.3 via nvm:
user#localhost:~/Desktop/demo$ nvm install 4.7.3
Downloading and installing node v4.7.3...
Downloading https://nodejs.org/dist/v4.7.3/node-v4.7.3-darwin-x64.tar.gz...
######################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v4.7.3 (npm v2.15.11)
user#localhost:~/Desktop/demo$ npm up -g
/Users/user/.nvm/versions/node/v4.7.3/bin/npm -> /Users/user/.nvm/versions/node/v4.7.3/lib/node_modules/npm/bin/npm-cli.js
npm#4.2.0 /Users/user/.nvm/versions/node/v4.7.3/lib/node_modules/npm
user#localhost:~/Desktop/demo$ npm -v
4.2.0
user#localhost:~/Desktop/demo$
I just upgrade node from v0.12.2 to v5.10.1 and node-debug appears to be broken for me.
When I run:
node-debug bin/www
I get the following error in Chrome:
Error: Cannot find module
'/usr/local/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v47-linux-x64/debug.node'
I don't have a node-v47-linux-x64 directory but I do have a node-v14-linux-x64 directory.
node -v
v5.10.1
npm -v
3.8.3
Any suggestions on how to fix this?
Clear npm cache and reinstalling modules seemed to work.
I reinstalled some modules globally (node-inspector...)
npm cache clear
npm install
The problem appears to be with me using nvm.
(note, global modules need to be reinstalled in each node version, including your system one, or they are not likely to work properly)
I want to use the node-sass module in my node.js v0.12 application to benefit from the performance of libsass.
I executed npm i node-sass to install the module, no errors so far.
Now the mess starts:
If I just open the REPL in a terminal to try out node-sass then everything works fine but if I include it in my project files and run node myfile.js then I get the following error message:
Error: `libsass` bindings not found. Try reinstalling `node-sass`?
The module's description at npmjs.com states that there might be a problem with resolving #!/usr/bin/env node under Ubuntu and how to fix this but that is not the case on my machine.
I could not find anything useful so I hope that you might help me.
I'm using node v0.12.2 under Ubuntu 14.10.
P.S.: I already tried to reinstall node-sass but without success. Nothing changes.
If you're using node 4.x or later then you need to reinstall gulp-sass with:
npm uninstall --save-dev gulp-sass
npm install --save-dev gulp-sass#2
You’ve probably tried to reinstall node-sass while using
npm install node-sass
or
npm uninstall node-sass
npm install node-sass
But node-sass is a C version of Sass. You have to use npm rebuild:
npm rebuild node-sass
I fixed this issue by deleting the existing /node_modules folder and running npm update
This is the only solution that worked for me,
sudo npm install -g n
sudo n 0.12.7
npm install node-sass#2
sudo npm -g install node-gyp#3
npm rebuild node-sass
This workaround (http://forum.ionicframework.com/t/error-running-gulp-sass/32311/20) worked form me.
Starting with this setup:
Cordova CLI: 5.3.3
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.6.5
Ionic App Lib Version: 0.3.9
ios-deploy version: Not installed
ios-sim version: 5.0.1
OS: Mac OS X Yosemite
Node Version: v4.1.1
Xcode version: Xcode 6.4 Build version 6E35b
I've found a solution to avoid to use 'sudo' command. We need before to fix npm permissions following this: https://docs.npmjs.com/getting-started/fixing-npm-permissions and fixing permissions for Node here: http://mawaha.com/permission-fix-node-js/ After this we can check and reinstall software without 'sudo' for npm, n or ionic.
I followed this step:
npm install -g n
rm -R node_modules/
npm install node-sass#3.3.3
npm -g install node-gyp#3
npm uninstall gulp-sass
npm install gulp-sass#2
npm rebuild node-sass
ionic setup sass
Why node-sass#3.3.3? Because it works with latest ionic version: https://github.com/driftyco/ionic/pull/4449
Combining the two answers above worked for me, plus additions:
sudo npm uninstall --save gulp-sass
npm install --save gulp-sass#2
npm update
npm rebuild node-sass
I have solved this to create the right directory with the specified binding.node file. You can download the bindings from github
https://github.com/sass/node-sass-binaries
Look in the error message the path where it tries to find the binding. In my case:
C:\Users\Martijn\Documents\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-46
So I create this map win32-x64-46 and copy the binding from github in.
My solution was to downgrade to v0.10.25 (try sudo n 0.10.25 if you use n)
For me, this issue was caused in my build system (Travis CI) by doing something kind of dumb in my .travis.yml file. In effect, I was calling npm install before nvm use 0.12, and this was causing node-sass to be built for 0.10 instead of 0.12. My solution was simply moving nvm use out of the .travis.yml file’s before_script section to before the npm install command, which was in the before_install section.
This was a Node version issue for me, try using nvm to backtrack your version to something like: 0.10.32. This worked for me. I was running 4.2.2
I solved this problem by updating my gcc from 4.4.x to 4.7.x
No need for sudo or re-installations. This has always worked for me:
nvm use 0.12.2
This is the steps I undertook to fix my issue.
I updated my node manually to the latest version
Reinstalled node-sass
npm install node-sass
3.npm audit fix to fix certain vulnerabilities.
`npm audit fix`
5.npm install node-sass
`npm install node-sass`
worked and compiled properly thereafter.
I apologize if anything related to my answer isn't right. I'm just a beginner.
Hope it works for you
I installed the node as new version. once i installed i checked in cmd for like this:
C:\Users\Mohamed.Arif>node --version && npm --version
v0.10.35
1.4.28
But after I installed the node, npm I am trying to install the latest yeoman. in their website, i noted the npm version requires v2.1.0+ - i confused here. how to i install the npm as they requested?
I am running the latest version of node only.
Install prerequisites
Before installing Yeoman, you will need the following:
Node.js v0.10.x+
npm (which comes bundled with Node) v2.1.0+
git
You can check if you have Node and npm installed by typing:
http://yeoman.io/codelab/setup.html
What is wrong here? I am working with windows7.
Thanks in advance!
See How do I update npm on Windows?
tl;dr - npm -g install npm does work, but the old version of npm is still in your PATH.
Option 3: navigate to C:\Program Files (x86)\nodejs with cmd.exe and then run
the installation without -g:
npm install npm