file as the current user 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.npm ERR! A complete log of this run can be found in: npm ERR!
/Users/sf/.npm/_logs/2020-08-03T03_10_14_193Z-debug.log
大概的报错信息如上
原因:缺少权限
解决方式:在命令前+sudo
sudo npm install -g create-react-app
创建完毕后使用yarn start或者npm start报错
- 使用yarn的报错
Command failed with exit code 1.
- npm start报错
There might be a problem with the project dependency tree. It is
likely not a bug in Create React App, but something you need to fix
locally.
解决方法
在全局终端中:
- cd ~
- ls =>在得到的反馈中查看是否有node_modules ,有的话进行第三步
- rm -rf node_modules //该步骤是不可逆的
然后再返回项目重新 npm install => npm start 即可启动