nhandled rejection Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache npm ERR! cb() never called!

安装全局包时报错,之前已经遇到过,结果第二次又忘记解决方法,果然还是要记下来,好记性不如烂笔头哇

$ npm i electron -g
Unhandled rejection Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\f23044b6'
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>

 

这个错误是因为没有管理员权限,解决方法,右键点击开始菜单,选择以管理员身份运行,在打开的黑窗再继续安装就可以

 

OK,安装成功

 

posted @ 2019-10-06 19:59  潇湘羽西  阅读(5736)  评论(0编辑  收藏  举报