When I run
npm --version at a normal command prompt, it gives a different version than when I run under an administrator command prompt, and I can’t upgrade the non-admin npm.
Background: My computer is set up with a locked down "main" account and a separate administrator account. I can run an app "as administrator", but when doing so I have to enter the admin account credentials, and the app then runs under that account.
So when I try to upgrade npm using
npm i -g npm, I get an EPERM error. But when I do the same as administrator, the upgrade succeeds but only for that other admin account.
Source: Windows Questions