Have done a lot of googling, tried reinstalling node.js using the official installer, but my npm pathing still doesn\'t work.
This doesn\'t work
npm
When you're on Windows
but running VS Code
in Windows Subsystem for Linux
like this
linux@user: /home$ code .
you actually want to install NodeJs
on Linux
with
linux@user: /home$ sudo apt install nodejs
Installing NodeJs
on Windows
, modifying PATH
and restarting will get you no results.
C:\Program Files\nodejs\node_modules\npm\bin
'add Environment Path to
C:\Program Files\nodejs\node.exe;C:\Users[your username]\AppData\Roaming\npm
Edit the System environment variables, and enter following path:
C:\Program Files\nodejs\node.exe;
C:\Users\{yourName}\AppData\Roaming\npm
Installed Node Version Manager (NVM) for Windows: https://github.com/coreybutler/nvm-windows
I'm using Windows 10 - 64 bit so I run... Commands:
nvm arch 64
(to make default the 64 bit executable)nvm list
(to list all available node versions)nvm install 8.0.0
(to download node version 8.0.0 - you can pick any)nvm use 8.0.0
(to use that specific version)In my case I had to just switch to version 8.5.0 and then switch back again to 8.0.0 and it was fixed. Apparently NVM sets the PATH variables whenever you do that switch.
steps 1 in the user variable and system variable
C:\Program Files\nodejs
then check both node -v
and the npm -v
then try to update the the npm i -g npm