webstorm react项目报错:Error: EPERM: operation not permitted
webstorm上导入了react项目,执行npm run start 之后就报错,
> cross-env APP_TYPE=site umi dev
fs.js:114
throw err;
^
Error: EPERM: operation not permitted, open 'path\node_modules\.cache\@babel\register\.babel.7.2.2.development.json'
at Object.openSync (fs.js:443:3)
at Object.writeFileSync (fs.js:1194:35)
at save (path\node_modules\@babel\register\lib\cache.js:52:15)
at process._tickCallback (internal/process/next_tick.js:61:11)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! unifast-react@1.0.0 start: `cross-env APP_TYPE=site umi dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the unifast-react@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache\_logs\2019-06-14T07_34_39_651Z-debug.log
Process finished with exit code 1
看错误信息是要写某个文件时没有权限,这时根据路径过去看下是个隐藏文件,打开看一下只有一对“{}”,
网上能搜到的方法一般都是用管理员权限去运行“命令行”,这时候发现没用,
然后有的提到让修改整个项目文件夹的属性,给当前用户添加修改权限,也没用,
最后可以试下给这个.babel.7.2.2.development.json文件重命名一下,加个“_bak”后缀,然后再去webstorm中运行一下,
此时可以正常编译运行了,