React中文官方文档给出创建新应用的最佳方式(命令行)。
npx create-react-app my-app
cd my-app
npm start
终端直接报错,提示如下:
bogon:~ jing$ npx creat-react-app myJob_react
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.com/creat-react-app - Not found
npm ERR! 404
npm ERR! 404 'creat-react-app@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jing/.npm/_logs/2020-08-25T08_15_11_792Z-debug.log
安装 [ 'creat-react-app@latest' ] 失败,错误代码:1
根据提示应该是没有全局安装creat-react-app这个脚手架工具造成的,因此我们需要先安装creat-react-app这个脚手架工具造成,安装命令提示入下:
npm install -g create-react-app
但是,我本地这样也给我报错了,也是醉了。
npm ERR! code E503
npm ERR! 503 Ser