在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,再次启动项目就不报错了。