npm-windows-upgrade not working

2019-07-24 05:20发布

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?

1条回答
聊天终结者
2楼-- · 2019-07-24 05:58

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

查看更多
登录 后发表回答