Nvm-windows: README lacks information about upgrading npm

Created on 22 Mar 2020  Â·  2Comments  Â·  Source: coreybutler/nvm-windows

There's a section about Uninstall existing npm, but the recommendations for upgrading are scattered in the issues.

The relationship between node, npm and nvm is not clear and it's not obvious if upgrading npm should be done through nvm or at least in a way that doesn't break nvm.

Most helpful comment

This is more of a "how Node works" type of thing, but your point is well taken. I do think clarifying language around this concept would be a valuable addition.

All 2 comments

This is more of a "how Node works" type of thing, but your point is well taken. I do think clarifying language around this concept would be a valuable addition.

[npm-windows-upgrade] does not work for me, but a variation of the technique mentioned in https://github.com/coreybutler/nvm-windows/issues/500#issuecomment-571619789 did work.

  1. Go to Node.js install directory (C:\Program Files\nodejs in my case)
  2. Rename the following files:

    • npm → npm-old

    • npm.cmd → npm-old.cmd

    • npx → npx-old

    • npx.cmd → npx-old.cmd

  3. Run npm-old install -g npm@latest
  4. Delete the files I renamed in step 2. (Step 3 should have created new files named npm, npm.cmd, etc.)

I am running Windows 10 Enterprise v1903 (build 18362.904) and nvm-windows 1.1.7

Edit: This is similar (but not quite equal to) of the techniques discovered by @rsshilli on StackOverflow, which was improved upon in https://github.com/coreybutler/nvm-windows/issues/300#issuecomment-488422378 and https://github.com/coreybutler/nvm-windows/issues/300#issuecomment-509576885. We keep reinventing the wheel in slightly different ways.

Was this page helpful?
0 / 5 - 0 ratings