Skip to content

Node.js

Scoop is necessary

This guide use scoop to install this binary, if you don't have it, check this guide

Install NVM

sh
scoop install nvm

Check all versions

sh
nvm list available

Install the last LTS

sh
nvm install 18.17.0

Use new version

sh
nvm use 18.17.0

Error npm update

When you try to update npm

sh
npm i -g npm

You will have this error

sh
npm ERR! code EEXIST
npm ERR! path C:\Users\user\scoop\apps\nvm\current\nodejs\nodejs\npm.cmd
npm ERR! Refusing to delete C:\Users\user\scoop\apps\nvm\current\nodejs\nodejs\npm.cmd: is outside C:\Users\user\scoop\apps\nvm\current\nodejs\nodejs\node_modules\npm and not a link
npm ERR! File exists: C:\Users\user\scoop\apps\nvm\current\nodejs\nodejs\npm.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-08-16T07_54_44_449Z-debug.log

To get latest NPM version from https://github.com/coreybutler/nvm-windows/issues/300#issuecomment-788810759

Rename current npm cli

sh
mv npm npm-old
mv npm.cmd npm-old.cmd
mv npx npx-old
mv npx.cmd npx-old.cmd

Find current CLI

sh
cd node_modules\
mv npm npm-old
cd npm-old\bin

Install new NPM version

sh
node npm-cli.js i -g npm@latest

MIT License