npm-windows-upgrade 不起作用 [英] npm-windows-upgrade not working
问题描述
当我运行 npm install --global --production npm-windows-upgrade
时,它似乎可以工作,但随后出现了一些错误:
When I run npm install --global --production npm-windows-upgrade
it seems to go to work but then give me a few errors:
错误:EPERM:不允许操作,重命名 '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'
错误:EPERM:不允许操作,重命名'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'
错误:EPERM:不允许操作,重命名'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'
我在 node_modules 下没有 .staging 文件夹.有人遇到过这个问题吗?
I don't have a .staging folder under node_modules. Has anyone had this problem?
推荐答案
您是否以管理员身份运行?这就是文档所说的,首先,通过从提升的 PowerShell 运行以下命令,确保您可以在系统上执行脚本.要以管理员身份运行 PowerShell,请单击开始,搜索 PowerShell,右键单击 PowerShell 并选择以管理员身份运行.
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
然后,要安装和使用此升级程序工具,请运行(也从提升的 PowerShell 或 cmd.exe):
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
我不确定您是否已经按照此处的说明进行操作:https://www.npmjs.com/package/npm-windows-upgrade
I wasn't sure if you have already followed the instructions here: https://www.npmjs.com/package/npm-windows-upgrade
这篇关于npm-windows-upgrade 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!