Can I change the version of npm my Glitch terminal uses?

I see lots of questions (including from me, and one in the FAQ) about changing the version of node that a project uses, but my search has not turned up anything about npm.

If I go to the terminal in my new project and run a command like npm test I get the message New major version of npm available! 7.20.6 -> 8.11.0. Is this something I can upgrade myself, or should I just wait for some kind of a system-wide upgrade?

FWIW, if I try to run the suggested command in the message, npm install -g npm@8.11.0, I get the following:

$ npm install -g npm@8.11.0
npm ERR! code EROFS
npm ERR! syscall rename
npm ERR! path /opt/nvm/versions/node/v16.14.2/lib/node_modules/npm
npm ERR! dest /opt/nvm/versions/node/v16.14.2/lib/node_modules/.npm-St7fCqPi
npm ERR! errno -30
npm ERR! rofs EROFS: read-only file system, rename '/opt/nvm/versions/node/v16.14.2/lib/node_modules/npm' -> '/opt/nvm/versions/node/v16.14.2/lib/node_modules/.npm-St7fCqPi'
npm ERR! rofs Often virtualized file systems, or other file systems
npm ERR! rofs that don't support symlinks, give this error.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npm-cache/16.14.2/_logs/2022-05-25T22_39_52_512Z-debug.log
1 Like

Hi there - your project container uses the version of npm that comes installed with whatever version of Node your project is using. At the moment, that’s the only mechanism for changing npm versions that we support.

I’ll make sure to get this info into a Help Doc so folks understand this going forward!

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.