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中运行一下,

此时可以正常编译运行了,

转载于:https://www.cnblogs.com/1394htw/p/11023629.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值