$create-react-app my-react
Success! Created my-react at D:\workSpace\my-react
Inside that directory, you can run several commands:
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 intothe app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd my-react
npm start
Happy hacking!
这条命令会帮我们构建一个叫my-react的工程,并自动安装我们所需要的依赖
安装完成后启动工程
$cdmy-app
$npm start
终端提示成功并会自动打开浏览器展示运行效果:
npm start
> my-react@0.1.0 start D:\workSpace\my-react> react-scripts start
Starting the development server...
Compiled successfully!
You can now view my-reactin the browser.Local: http://localhost:3000/On Your Network: http://192.168.31.241:3000/
Note that the development build is not optimized.To create a production build, use npm run build.