I am using nvm to manage my Node.js versions. Recently, I installed Node.js version 18.16.0 using nvm, but when I try to use npm, I get the following error message:
npm v9.5.1 is known not to run on Node.js v18.16.0
I've searched for solutions online, but most of them seem to be related to installing a different version of Node.js. I'd like to stick with Node.js v18.16.0 if possible, since it's the version that works best with my project.
I have tried uninstalling and reinstalling Node.js and npm using nvm, but I still get the same error message.
Does anyone have any idea why I am getting this error message, and how I can resolve it?
This phenomenon is not a node problem.
It's an nvm version issue.
If you reinstall node 18.16.0 after updating nvm to the latest version, it works normally.
I was stuck with an old version of NVM on Windows.
go to the NVM-windows release page and get an installer that works for you.
then uninstall the old node/npm version to re-install it. See the steps below.
# run the following to re-install node and npm
$ nvm list
* 18.16.0 (Currently using 64-bit executable)
16.13.2
# get an old version
$ nvm use 16.13.2
Now using node v16.13.2 (64-bit)
# uninstall
$ nvm uninstall 18.16.0
Uninstalling node v18.16.0... done
# reinstall
$ nvm install 18.16.0
Downloading node.js version 18.16.0 (64-bit)...
Extracting node and npm...
Complete
npm v9.5.1 installed successfully.
Installation complete. If you want to use this version, type
# run / use it
$ nvm use 18.16.0
Now using node v18.16.0 (64-bit)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With