webstorm react項目報錯:Error: EPERM: operation not permitted

webstorm上導入了react項目,執行npm run start 以後就報錯,node

> cross-env APP_TYPE=site umi devreact

fs.js:114
throw err;
^web

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

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.logjson

Process finished with exit code 1bootstrap

看錯誤信息是要寫某個文件時沒有權限,這時根據路徑過去看下是個隱藏文件,打開看一下只有一對「{}」,babel

網上能搜到的方法通常都是用管理員權限去運行「命令行」,這時候發現沒用,webstorm

而後有的提到讓修改整個項目文件夾的屬性,給當前用戶添加修改權限,也沒用,this

最後能夠試下給這個.babel.7.2.2.development.json文件重命名一下,加個「_bak」後綴,而後再去webstorm中運行一下,命令行

此時能夠正常編譯運行了,

相關文章
相關標籤/搜索