Node-debug broken after upgrading node via nvm - linux

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)

Related

npx is not working after installing node 16.3.0 on ubuntu 21.10 with nvm

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

Npm -v error: cannot find module 'are-we-there-yet'

I recently upgraded nodejs from v6.9.2 to V10.16.3. But after the upgrade I am not able to do npm install.
npm -v gives the following error -
Error: cannot find module 'are-we-there-yet'
I have tried uninstalling nodejs and reinstalled it. But still getting the same error.
Any solution would be really helpful.
Hm, pretty strange error, try to install it globally with npm i are-we-there-yet -g
You have broken npm by removing some of its dependencies. are-we-there-yet is a dependency of npmlog which is a dependency of npm itself, and you somehow deleted it.
So you have to reinstall the node from scratch - https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

npm -v still showing version 2.x.x after installing npm3

I am starting to use Angular 2, which requires npm 3.x.x, so I installed it with npm install -g npm3. The Angular 2 tutorials tell me to verify that I have npm 3.x.x by running npm -v, however when I run that, it still says I have version 2.15.8. It shows that I have version 3.10.7 if I run npm3 -v, but not if I run npm -v. Is this going to cause errors? Do I need to it to say I'm using version 3.x.x when I run npm -v? If so, what do I need to do?
EDIT:
Node.js version: node -v reveals that I am using v4.4.7 (Angular2 requires something between 4.4.x - 5.x.x, so I should be good here)
OS: I am currently using Windows 10 on a PC, but have had the same issue with my Mac.
Upgrade npm using this command - npm install -g npm
Maybe this helps:
https://www.google.de/search?q=update+npm+windows
Updating npm with npm itself will store npm.cmd in ../appdata/roaming/.
To avoid conflicts with an older npm version you need to remove npm.cmd from C:\Program Files\nodejs\npm.cmd

npm not installing even after installing node

I'm setting up a new project to work on and the goal is to install Grunt and Bower. Now Both of them require to have installed the latest npm & Node.js versions. As I was installing it I faced a few problem with git that was able to fix. Where I'm stuck now, is that after installing everything as listed in all the online guides apparently npm is not there...? the npm site mentions that this would be installed with Node.js and still after installing, looks like npm is not there....
here is what I got:
user-mbp:~ username$ git --version
git version 2.1.3.36.g8e36a6d
user-mbp:~ username$ node -v
v0.12.2
user-mbp:~ username$ brew -v
Homebrew 0.9.5
user-mbp:~ username$ sass -v
Sass 3.4.13 (Selective Steve)
user-mbp:~ username$ npm -v
-bash: npm: command not found
Thanks in advance for your help.
uninstall everything and re-installing node.js did fix this. Not sure why it didn't work the first time.

libsass bindings not found when using node-sass in nodejs

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

Resources