创建react脚手架的过程中
安装完yarn之后,输入yarn global add create-react-app后,再输入create-react-app my-website报错
提示信息为:‘create-react-app’ 不是内部或外部命令,也不是可运行的程序
或批处理文件。
处理方法:
- 网上说找到对比npm config list中的prefix路径和环境变量中npm的路径是否一样,不一样就更改。
没有解决× - npm install -g create-react-app
npm install -g create-react-app yarn
yarn add create-react-app 虽然node_moudle出来了,可是create-react-app还是报错
没有解决× - https://github.com/facebook/create-react-app 官方文档指路
看到Quick Overview下
npx create-react-app my-app
完美解决√