npm ERR! Error: EPERM: operation not permitted, unlink ‘C:/Program Files/nodejs/node_cache/_logs/201

2 篇文章 0 订阅
1 篇文章 0 订阅

在webstrom  npm start 运行项目时,报错:

npm ERR! path C:/Program Files/nodejs/node_cache/_logs/2019-10-10T08_17_07_526Z-debug.log
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:/Program Files/nodejs/node_cache/_logs/2019-10-10T08_17_07_526Z-debug.log'
npm ERR!     at Object.unlinkSync (fs.js:951:3)
npm ERR!     at fixWinEPERMSync (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\rimraf\rimraf.js:211:13)
npm ERR!     at Function.rimrafSync [as sync] (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\rimraf\rimraf.js:311:28)
npm ERR!     at C:\Program Files\nodejs\node_global\node_modules\npm\lib\npm.js:333:20
npm ERR!     at f (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\once\once.js:25:25)
npm ERR!     at Glob.<anonymous> (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:151:7)
npm ERR!     at Glob.emit (events.js:189:13)
npm ERR!     at Glob._finish (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:197:8)
npm ERR!     at done (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:182:14)
npm ERR!     at Glob._processReaddir2 (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:434:12)
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:/Program Files/nodejs/node_cache/_logs/2019-10-10T08_17_07_526Z-debug.log'
npm ERR!     at Object.unlinkSync (fs.js:951:3)
npm ERR!     at fixWinEPERMSync (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\rimraf\rimraf.js:211:13)
npm ERR!     at Function.rimrafSync [as sync] (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\rimraf\rimraf.js:311:28)
npm ERR!     at C:\Program Files\nodejs\node_global\node_modules\npm\lib\npm.js:333:20
npm ERR!     at f (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\once\once.js:25:25)
npm ERR!     at Glob.<anonymous> (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:151:7)
npm ERR!     at Glob.emit (events.js:189:13)
npm ERR!     at Glob._finish (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:197:8)
npm ERR!     at done (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:182:14)
npm ERR!     at Glob._processReaddir2 (C:\Program Files\nodejs\node_global\node_modules\npm\node_modules\glob\glob.js:434:12)
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink \'C:/Program Files/nodejs/node_cache/_logs/2019-10-10T08_17_07_526Z-debug.log\'\n    at Object.unlinkSync (fs.js:951:3)\n    at f
ixWinEPERMSync (C:\\Program Files\\nodejs\\node_global\\node_modules\\npm\\node_modules\\rimraf\\rimraf.js:211:13)\n    at Function.rimrafSync [as sync] (C:\\Program Files\\nodejs\\node_gl
obal\\node_modules\\npm\\node_modules\\rimraf\\rimraf.js:311:28)\n    at C:\\Program Files\\nodejs\\node_global\\node_modules\\npm\\lib\\npm.js:333:20\n    at f (C:\\Program Files\\nodejs\
\node_global\\node_modules\\npm\\node_modules\\once\\once.js:25:25)\n    at Glob.<anonymous> (C:\\Program Files\\nodejs\\node_global\\node_modules\\npm\\node_modules\\glob\\glob.js:151:7)\
n    at Glob.emit (events.js:189:13)\n    at Glob._finish (C:\\Program Files\\nodejs\\node_global\\node_modules\\npm\\node_modules\\glob\\glob.js:197:8)\n    at done (C:\\Program Files\\no
dejs\\node_global\\node_modules\\npm\\node_modules\\glob\\glob.js:182:14)\n    at Glob._processReaddir2 (C:\\Program Files\\nodejs\\node_global\\node_modules\\npm\\node_modules\\glob\\glob
.js:434:12)',
npm ERR!   errno: -4048,
npm ERR!   syscall: 'unlink',
npm ERR!   code: 'EPERM',
npm ERR!   path:
npm ERR!    'C:/Program Files/nodejs/node_cache/_logs/2019-10-10T08_17_07_526Z-debug.log' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

显示没权限,解决办法:

以管理员身份运行cmd,再次启动项目就不报错了。

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值