Install latest nvm for node version 12.22.6
gabitianu opened this issue · comments
Operating system and version:
nvm debug
output:
nvm ls
output:
How did you install nvm
?
brew
What steps did you perform?
nvm install-latest-npm
What happened?
Attempting to upgrade to the latest working version of npm...
- Installing latest
npm
; if this does not work on your node version, please report a bug!
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: npm@9.2.0
npm ERR! notsup Not compatible with your version of node/npm: npm@9.2.0
npm ERR! notsup Required: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"}
npm ERR! notsup Actual: {"npm":"8.19.1","node":"v12.22.6"}
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/I327776/.npm/_logs/2022-12-10T11_29_41_781Z-debug-0.log
- npm upgraded to: v8.19.1
What did you expect to happen?
I expected to have npm version 8.19.3, but got error instead
Is there anything in any of your profile files that modifies the PATH
?
To fix this issue, yo need to upgrade your version of Node.js to a version that is compatible with the latest version of npm. You can do this by using nvm to install the latest version of Node.js on your system. and before that install nvm too if not already installed
$brew install nvm
once done do this
$nvm install-latest-npm
this will install the latest version in your system.
after this you will not encounter the "Unsupported engine" error.
if it is the path related issue I believe installing 'nvm' using 'brew' will take care it, it will be added to the path variable directly.
Definitely do not install either nvm or node with brew.
@gabitianu nvm is unsupported when installed with homebrew. I suggest removing it and installing it properly with bot instructions in the readme.
You’re also using an older version of nvm; v0.39.2 is latest.
To fix this issue, yo need to upgrade your version of Node.js to a version that is compatible with the latest version of npm. You can do this by using nvm to install the latest version of Node.js on your system. and before that install nvm too if not already installed $brew install nvm once done do this $nvm install-latest-npm this will install the latest version in your system. after this you will not encounter the "Unsupported engine" error.
if it is the path related issue I believe installing 'nvm' using 'brew' will take care it, it will be added to the path variable directly.
nvm install-latest-npm is supposed to install the latest npm available for the current node, it should work with any version, not just the latest
My bad, npm was installed correctly, not through brew, but it was not updated to the latest version. After upgrade, I see the expected message: * npm upgraded to: v8.19.3.
It's a pity that you don't support nvm through homebrew, maybe you'll consider it in the future.
I doubt I will ever consider it; I don't distribute nvm on homebrew, thus it shouldn't be installed via homebrew - and I have no plans to start using homebrew such that i'd want to distribute nvm on it.