Wednesday, January 1, 2020

Powershell script to update node and npm

Powershell script to update node and npm.
Open Powershell as Administrator

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

/*--Update Node.js*/
wget https://nodejs.org/download/release/latest/win-x64/node.exe -OutFile 'C:\Program Files\nodejs\node.exe'

/*Update NPM*/
npm uninstall -g npm
npm i -g npm@next

/*Check version*/
node -v
npm -v