在文件夹路径下打开cmd
注:这方法可能就我自己觉着省事儿,聊作借鉴
安装成功后,直接关闭管理员权限的命令行
在项目所在的文件夹下,把文件夹路径删掉,打 cmd 然后敲回车
1、文件夹路径 ↓ ↓ ↓
2、选中文件夹路径 ↓ ↓ ↓
3、嵌入cmd ↓ ↓ ↓
4、打开该路径下的cmd ↓ ↓ ↓
5、创建项目↓ ↓ ↓
D:\git_work2\reactProject>create-react-app myFirstReact
Could not create a project called "myFirstReact" because of npm naming restrictions:
* name can no longer contain capital letters
so,不接受大写字母~↑↑↑
D:\git_work2\reactProject>create-react-app myfirstreact
Creating a new React app in D:\git_work2\reactProject\myfirstreact.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
现在好了↑↑↑
+ react-scripts@2.1.1
+ react@16.6.3
+ react-dom@16.6.3
added 1701 packages in 99.851s
Success! Created myfirstreact at D:\git_work2\reactProject\myfirstreact
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 myfirstreact
npm start
Happy hacking!
D:\git_work2\reactProject>cd myfirstreact
D:\git_work2\reactProject\myfirstreact>npm start
> myfirstreact@0.1.0 start D:\git_work2\reactProject\myfirstreact
> react-scripts start
Starting the development server...
Compiled successfully!
You can now view myfirstreact in the browser.
Local: http://localhost:3000/
On Your Network: http://10.6.24.255:3000/
Note that the development build is not optimized.
To create a production build, use npm run build.
over↑↑↑