2

When I run npm install --global --production npm-windows-upgrade it seems to go to work but then give me a few errors:

Error: EPERM: operation not permitted, rename 'C:\Users\MyUserName\AppData\Roaming\npm\node_modules.staging\lodash-36ccc657' -> 'C:\Users\MyUserName\AppData\Roaming\npm\node_modules\npm-windows-upgrade\node_modules\lodash'

Error: EPERM: operation not permitted, rename 'C:\Users\MyUserName\AppData\Roaming\npm\node_modules.staging\lodash-36ccc657' -> 'C:\Users\MyUserName\AppData\Roaming\npm\node_modules\npm-windows-upgrade\node_modules\lodash'

Error: EPERM: operation not permitted, rename 'C:\Users\MyUserName\AppData\Roaming\npm\node_modules.staging\lodash-36ccc657' -> 'C:\Users\MyUserName\AppData\Roaming\npm\node_modules\npm-windows-upgrade\node_modules\lodash'

I don't have a .staging folder under node_modules. Has anyone had this problem?

Sam
  • 26,817
  • 58
  • 206
  • 383

1 Answers1

5

Are you running that as an administrator ? This is what documentation says, first, ensure that you can execute scripts on your system by running the following command from an elevated PowerShell. To run PowerShell as Administrator, click Start, search for PowerShell, right-click PowerShell and select Run as Administrator.

Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force

Then, to install and use this upgrader tool, run (also from an elevated PowerShell or cmd.exe):

npm install --global --production npm-windows-upgrade
npm-windows-upgrade

I wasn't sure if you have already followed the instructions here: https://www.npmjs.com/package/npm-windows-upgrade

Sandip Subedi
  • 1,039
  • 1
  • 14
  • 34
  • 1
    I wasn't doing this in PowerShell. This fixed the issue. Thanks. – Sam Oct 13 '16 at 00:00
  • 1
    `npm-windows-upgrade` can't run with my current version of node (`0.12.0`); I get an error saying that the use of `const` is not allowed in `'strict mode'`. Amusingly enough, I'm trying to upgrade my version of node in order to fix exactly this error with another set of files! – Gershom Maes Sep 22 '17 at 13:37