You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project I'm developing is running on a much older version of Node (v12), so after installing Node 12, I updated npm out of habit. Now, npm is on v9.3.1, and when I attempt to run any command with it, I get an error that more or less says that npm 9 cannot run on Node v12 (error message pasted below with name of user directory redacted due to security concerns).
ERROR: npm v9.3.1 is known not to run on Node.js v12.7.0. You'll need to upgrade
to a newer Node.js version in order to use this version of npm. This version of
npm supports the following node versions: `^14.17.0 || ^16.13.0 || >=18.0.0`. You
can find the latest version at https://nodejs.org/.
ERROR:
/Users/[USERNAME]/.local/share/nvm/v12.7.0/lib/node_modules/npm/lib/utils/exit-handler.js:21
const hasLoadedNpm = npm?.config.loaded
^
SyntaxError: Unexpected token .
at Module._compile (internal/modules/cjs/loader.js:720:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
at Module.load (internal/modules/cjs/loader.js:643:32)
at Function.Module._load (internal/modules/cjs/loader.js:556:12)
at Module.require (internal/modules/cjs/loader.js:683:19)
at require (internal/modules/cjs/helpers.js:16:16)
at module.exports (/Users/[USERNAME]/.local/share/nvm/v12.7.0/lib/node_modules/npm/lib/cli.js:81:23)
at Object.<anonymous> (/Users/[USERNAME]/.local/share/nvm/v12.7.0/lib/node_modules/npm/bin/npm-cli.js:2:25)
at Module._compile (internal/modules/cjs/loader.js:777:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
I get the issue of later versions of npm being incompatible with older versions of Node, and that it's like trying to play a 4K Blu-ray on a LaserDisc player, but I would've thought that Node/npm would have something built-in to only install the latest compatible version of npm for any particular version of Node.
Is there a way to control which version of npm is used much in the same way as switching versions of Node?
The text was updated successfully, but these errors were encountered:
The project I'm developing is running on a much older version of Node (v12), so after installing Node 12, I updated npm out of habit. Now, npm is on v9.3.1, and when I attempt to run any command with it, I get an error that more or less says that npm 9 cannot run on Node v12 (error message pasted below with name of user directory redacted due to security concerns).
I get the issue of later versions of npm being incompatible with older versions of Node, and that it's like trying to play a 4K Blu-ray on a LaserDisc player, but I would've thought that Node/npm would have something built-in to only install the latest compatible version of npm for any particular version of Node.
Is there a way to control which version of npm is used much in the same way as switching versions of Node?
The text was updated successfully, but these errors were encountered: