Unable to update to npm@latest

Hi, im tryna update one of my repls to use a newer version of NPM.

In the replit.nix file, i have it set to use Node16 but the NPM itself cannot be updated as I dont have permissions, or something like that? The command i used was npm i npm@9.5.3 -g and i got the Permissions error.

Using the -g flag to update a package causes permission issues, and you can’t have sudo access in a repl container. Try without the -g flag and it should work. Alternatively, you can get the latest available version on nix

1 Like

Tried this, hasnt changed anything?



1 Like

If this is the latest version of npm that nix supports, then unfortunately you can’t use the latest version unless it’s on nix.


Try running kill 1 in the shell. Also note that if your repl has a integrated console, you will probably need to update that too.

i ran kill 1 already. Didnt work. What did you mean by updating the console?

I don’t know about node, but for python, even when the shell is the latest version, you have to do extra configuration for your console to be on the latest too.

even so, i have the nodejs-16_x part which i took from the Replit documentation… and yet my shell still shows using 14_x