



A list of versions matched between NPM and Node.js ( ) - but you will need to download the Node.js installer and run that to update Node.js ( ).Allows easy upgrades and downgrades and to install a specific version.Does not change the default global package location.Upgrades npm in-place, where Node.js installed it.Note: if you run the Node.js installer, it will replace the Node.js version. Run PowerShell as Administrator Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force Consider updating to latest LTS release of Node.js.What method should I choose to update NPM? If you want to update Node.js over a CLI on windows, I recommend running winget upgrade -q NodeJS or use chocolatey for that. JavaScript JS Node.Note: The question is specifically asking how to upgrade npm, not Node.js. All you have to do is download the latest version from the Node.js page and then install it over the current version. If the Powershell script shown above does not work anymore, Node.js can also be updated “manually”. Whether the update was successful can be tested with the following command. Should you use the 32-bit (x86) variant, this is done with the following command: wget -OutFile 'C:\Program Files (x86)\nodejs\node.exe'įor the 64-bit (圆4) variant, the following command must be used: wget -OutFile 'C:\Program Files\nodejs\node.exe' node -v Update Node.js on WindowsĪdd-Type -AssemblyName System.IO.Compression.FileSystemĪlternatively, only the Node.js binary can be exchanged via WGET.

npm -v Update Node.js on Linux and macOS (OS X)Įach line is to be issued as a single command: Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force The following commands have to be set in Powershell (Start -> “powershell” -> right click -> Run as Administrator). Once for macOS (OSX) / Linux and once for Windows. Therefore, here are the short and concise CMD/Shell/Bash commands for updating Node.js and NPM. Every time I forget the command line commands for it. But before I start, I’d like to update to the latest version, and that’s where the dilemma starts. Every few months I write smaller projects with Node.js. Today’s article falls into the category “reminder”.
