安装
npm install -g create-react-app
创建项目
项目名称不能大写
create-react-app 项目名称
// 创建ts版
create-react-app 项目名称 --template typescript
创建完成
yarn 或 npm run
Success! Created react007 at /Users/fanis/test/react/react007
Inside that directory, you can run several commands:
yarn start
Starts the development server.
yarn build
Bundles the app into static files for production.
yarn test
Starts the test runner.
yarn eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd react007
yarn start
本文介绍了如何通过npm全局安装create-react-app,然后使用它来创建一个React项目。创建过程中提到了项目名称不能使用大写字母,并可以选择typescript模板。创建成功后,可以运行几个关键命令,如启动开发服务器、打包生产文件、运行测试和 eject 以获取更深度的项目控制。建议初学者从运行项目并启动开发服务器开始。
1469

被折叠的 条评论
为什么被折叠?



