- 安装node、npm
从官网下载 LTS 版本点击安装,npm
会和node
一并安装
~ % node -v
v16.17.0
~ % npm -v
8.15.0
- Create React App
下面三种方法三选一
npx create-react-app my-app
npm init react-app my-app
yarn create react-app my-app
npx create-react-app my-app
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run 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!
第一次执行会提醒 安装 create-react-app@5.0.1
直接 yes
安装即可
网友评论