React开发环境的搭建
React
- React开发环境的搭建
点击查看代码
C:\Users\Thinkpad>node -v
v16.13.0
C:\Users\Thinkpad>npm -v
8.1.0
C:\Users\Thinkpad>npm install -g create-react-app
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
added 67 packages in 13s
C:\Users\Thinkpad>e:
E:\>mkdir ReactDemo
E:\>cd ReactDemo
E:\ReactDemo>create-react-app demo01
Creating a new React app in E:\ReactDemo\demo01.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1368 packages in 3m
Initialized a git repository.
Installing template dependencies using npm...
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
added 38 packages in 13s
Removing template package using npm...
removed 1 package in 4s
Created git commit.
Success! Created demo01 at E:\ReactDemo\demo01
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 into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd demo01
npm start
Happy hacking!
E:\ReactDemo>dir
驱动器 E 中的卷是 新加卷
卷的序列号是 08E3-5EFB
E:\ReactDemo 的目录
2022/03/02 19:49 <DIR> .
2022/03/02 19:49 <DIR> ..
2022/03/02 19:52 <DIR> demo01
0 个文件 0 字节
3 个目录 29,741,875,200 可用字节
E:\ReactDemo>cd demo01
E:\ReactDemo\demo01>dir
驱动器 E 中的卷是 新加卷
卷的序列号是 08E3-5EFB
E:\ReactDemo\demo01 的目录
2022/03/02 19:52 <DIR> .
2022/03/02 19:52 <DIR> ..
2022/03/02 19:50 310 .gitignore
2022/03/02 19:53 <DIR> node_modules
2022/03/02 19:53 1,121,815 package-lock.json
2022/03/02 19:53 809 package.json
2022/03/02 19:52 <DIR> public
2022/03/02 19:51 3,359 README.md
2022/03/02 19:52 <DIR> src
4 个文件 1,126,293 字节
5 个目录 29,741,875,200 可用字节
E:\ReactDemo\demo01>npm start
本文来自博客园,作者:寻月隐君,转载请注明原文链接:https://www.cnblogs.com/QiaoPengjun/p/15956821.html