安装vue-cli时出错

When i run npm install -g vue-cli , it continuously throws this error message:

Screen shot

错误的ERR!路径C:\ Users \ End User \ AppData \ Roaming \ npm \ node_modules \ vue-cli \ node_modules \ nan \ package.json npm ERR!代码EPERM npm ERR! errno -4048 npm ERR!系统调用unlink npm ERR!错误:EPERM:不允许操作,取消链接'C:\ Users \ End User \ AppData \ Roaming \ npm \ node_modules \ vue-cli \ node_modules \ nan \ package.json'npm ERR!在错误(本机)npm ERR! {错误:EPERM:不允许操作,取消链接'C:\ Users \ End User \ AppData \ Roaming \ npm \ node_modules \ vue-cli \ node_modules \ nan \ package.json'npm ERR!在错误(本机)npm ERR! stack:'错误:EPERM:不允许操作,取消链接'C:\ Users \ End User \ AppData \ Roaming \ npm \ node_modules \ vue-cli \ node_modules \ nan \ package.json '\ n出错(本机) ',npm ERR!错误:-4048,npm ERR!代码:'EPERM',npm ERR!系统调用:'unlink',npm ERR!路径:'C:\ Users \ End User \ AppData \ Roaming \ npm \ node_modules \ vue-cli \ node_modules \ nan \ package.json'} npm ERR!错误的ERR!请尝试以root / Administrator身份再次运行此命令 .

错误的ERR!可以在以下位置找到此运行的完整日志:npm ERR! C:\ Users \ End User \ AppData \ Roaming \ npm-cache_logs \ 2017-09-10T06_15_03_457Z-debug.log

  • I tried all the possible solutions found online :

  • running from windows cmd with administrator access,

  • npm cache clean

  • closed my text editor

  • restarted my PC

请帮我解决这个问题 .

回答(1)

2 years ago

我的Mac上也有问题,但也许这里有一些提示可以帮到你

  • goto文件夹:C:\ Users \ End User \ AppData \ Roaming \ npm \ node_modules(在Windows中确保启用所有文件夹)

  • 将文件夹 @vuevue-cli 移至垃圾箱(之前的版本)

  • 以管理员身份运行cmd.exe!

  • npm install @ vue / cli -g

希望这个技巧对你有用,请参阅Mac OS : Install vue cli does work properly以获得关于mac问题的答案

谢谢