node版本10.14.2 下载地址

如果是其版本的话会出错 css-loader 会不兼容 主要是8.x的版本不兼容

npm install -g create-react-app 全局安装 create-react-app

create-react-app react_app 使用create-react-app安装一个react脚手架 文件夹为 react_app

D:\>create-react-app react_app

Creating a new React app in D:\react_app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts... yarn add v1.12.3
[/] Resolving packages...
[/] Fetching packages...
info fsevents@1.2.: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[/] Linking dependencies...
[/] Building fresh packages... success Saved lockfile.
success Saved new dependencies.
info Direct dependencies
├─ react-dom@16.6.
├─ react-scripts@2.1.
└─ react@16.6.
info All dependencies
├─ babel-preset-react-app@6.1.
├─ react-dev-utils@6.1.
├─ react-dom@16.6.
├─ react-error-overlay@5.1.
├─ react-scripts@2.1.
└─ react@16.6.
Done in .77s. Success! Created react_app at D:\react_app
Inside that directory, you can run several commands:

表示安装成功

yarn start 或者 npm run start 启动项目

05-28 21:23