React创建项目报错 Error: EACCES: permission denied, open '/Users/****/.babel.json'

fs.js:549

  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);

                 ^


Error: EACCES: permission denied, open '/Users/leicunjie/.babel.json'

    at Error (native)

    at Object.fs.openSync (fs.js:549:18)

    at Object.fs.writeFileSync (fs.js:1156:15)

    at save (/Users/leicunjie/HelloWorld/node_modules/react-native/node_modules/babel-register/lib/cache.js:57:40)

    at nextTickCallbackWith0Args (node.js:420:9)

    at process._tickCallback (node.js:349:13)



解决方法:


执行命令

sudo chown -R $(whoami) ~/.npm

then

重新init工程

©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页