Likely it means you are behind a proxy server.
To tell nvm about it you need to run the command:
nvm proxy [url of your proxy server]
For example
nvm proxy http://example.com:8080
For docs on that command and other nvm for windows commands see https://github.com/coreybutler/nvm-windows#usage
Answer from rooby on Stack OverflowVideos
Likely it means you are behind a proxy server.
To tell nvm about it you need to run the command:
nvm proxy [url of your proxy server]
For example
nvm proxy http://example.com:8080
For docs on that command and other nvm for windows commands see https://github.com/coreybutler/nvm-windows#usage
Same problem and my solution was:
nvm off
nvm on
nvm install lts 64
nvm use newest
And for check:
nvm list
node -v
npm -v
If you have installed nvm using homebrew and are trying to install the node using command nvm install <some_version>, you will face errors on apple silicon machines (ARM) for versions lower than 15. Node versions older than 15 do not work on apple silicon machines (ARM) because ARM architecture is not supported.
For anything under v15, you will need to install node using Rosetta 2.
- How to open terminal in Rosetta2 mode: Go to Application -> Right click on terminal app -> Get Info -> Select "Open using Rosetta" -> Restart Terminal
- In Terminal, write ->
arch -x86_64 zsh
Now you will able to install any version of node (even multiple versions)
it wasn't an issue while i was trying to install node 12.X.X but below that it was a big pain so i followed below steps and it worked for me
Uninstalled nvm if it’s already installed using Homebrew.
brew uninstall nvm
brew cleanup
Install Rosetta
softwareupdate --install-rosetta
Make terminal/iTerm2 to open in Rosetta mode
got to Application (-> utilities) -> right click on terminal app -> get Info -> Select "Open using Rosetta" -> Restart Terminal
In Terminal run a command
arch -x86_64 zsh
Make sure machine has .zshrc file if not just create one
cd ~
touch .zshrc
Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
Restart the terminal and check if nvm is installed successfully by running
nvm -v
Then install Node with nvm as usual
nvm install 10
Installing the latest version of node using nvm:
Install the latest nvm through its Github repo:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
source ~/.bashrc
check the latest version of node and select it:
nvm list-remote
Out:
...
v20.15.0 (LTS: Iron)
v20.15.1 (LTS: Iron)
v20.16.0 (Latest LTS: Iron)
v21.0.0
v21.1.0
v21.2.0
v21.3.0
v21.4.0
v21.5.0
v21.6.0
v21.6.1
v21.6.2
v21.7.0
v21.7.1
v21.7.2
v21.7.3
v22.0.0
v22.1.0
v22.2.0
v22.3.0
v22.4.0
v22.4.1
v22.5.0
v22.5.1
v22.6.0
Install the desired version of node:
nvm install v20.16.0
INSTALL (Node Version Manager) be following command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bashNow, reopen your terminal, or "
exit" command if you server ssh and reconnectGet packages by following command:
nvm install 20Veryfiy node by:
node -v# should print v20.16.0Finally check the npm:
npm -v # should print '10.8.1'
Gongrates! You have done!
This may work:
nvm install NEW_VERSION --reinstall-packages-from=OLD_VERSION
For example:
nvm install 6.7 --reinstall-packages-from=6.4
then, if you want, you can delete your previous version with:
nvm uninstall OLD_VERSION
Where, in your case, NEW_VERSION = 5.4 OLD_VERSION = 5.0
Alternatively, try:
nvm install node --reinstall-packages-from=current
Or you can update to the last long-term support version with
nvm install lts --reinstall-packages-from=current
You can more simply run one of the following commands:
Latest version:
nvm install node --reinstall-packages-from=node
Stable (LTS) version: (if currently in use)
nvm install "lts/*" --reinstall-packages-from="$(nvm current)"
This will install the appropriate version and reinstall all packages from the currently used node version.
This saves you from manually handling the specific versions.
Kudos to @m4js7er for commenting about the LTS version.