I am using nvm to manage my Node.js versions. Recently, I installed Node.js version 18.17.1 using nvm, but when I try to use npm, I get the following error message:
ERROR: npm v9.6.7 is known not to run on Node.js v18.17.1.
I previously used Node.js version 16.13.0. So I tried switching to this version and re-install Node.js version 18.17.1. But it didn't work. Does anyone have any idea why I am getting this error message, and how I can resolve it?
I had a similar error with Node.js v18.17.0. I solved it by removing environment variables from previous Node.js installs. Specifically, I removed the npm and node.js variables from System Parameters, path.