0

I've been trying to update npm on windows and found this post which provided a solution where the following commands were supposed to be run:

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade

The first command executes seemingly correctly, but when I try running the second one, I get this log which seems to indicate that a version of windows upgrade needs to be specified. So I then ran: npm install -g npm-windows-upgrade 6.9.1 and got this error log

Of course when the last command of npm-windows-upgrade is run, I get the error that it isn't recognized. The other SO post had a solution for either removing both of these files:

C:\Program Files (x86)\nodejs\npm
C:\Program Files (x86)\nodejs\npm.cmd

or

running this command in an elevated powershell:

npm install npm@latest

As I don't have admin rights (and can't really acquire them) on my computer and given that both of these options require admin rights, how can I go about upgrading node.js on Windows?

Community
  • 1
  • 1
loremIpsum1771
  • 2,497
  • 5
  • 40
  • 87

1 Answers1

2

i never did use npm-windows-upgrade but it seam like you need to run cmd as administration otherwise i recommande using n Run cmd as adminstrator and install n using :

> npm install -g n

then Upgrade or install the latest official release using :

> n latest

Upgrade or install the stable official release using :

> n stable

Upgrade or install the latest LTS official release:

> n lts
eGhoul
  • 2,490
  • 1
  • 13
  • 17
  • I tried installing n but got this [error log] (https://gist.github.com/loremIpsum1771/20b52a1fd26df221ed5cc9eaf4ac155c) – loremIpsum1771 Jul 05 '16 at 16:44
  • you need to run cmd as administrator , if the problem doesn't solve then you have probably proxy or firewall problem if so check this issue [link](https://github.com/npm/npm/issues/8048) – eGhoul Jul 05 '16 at 17:14