参考文章 https://www.cnblogs.com/jianan/p/9564259.html
node官网 https://nodejs.org/en/download/
Windows64下载连接 https://nodejs.org/dist/v14.15.0/node-v14.15.0-x64.msi
点击安装,一路next
配置环境
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
$ npm config set registry https://registry.npm.taobao.org
安装react
npm install -g create-react-app
create-react-app first-react-demo
npm start 开始启动项目
npm run build 编译项目
在package.json 修改目录 "homepage":"/root/react",或者 "homepage":".",
**安装报错 vscode cnpm install -g create-react-app cnpm : 无法加载文件 C:\Users\10672\AppData\Roaming\npm\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsof t.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 行:1 字符:
解决方法:
1.右键VSCode,进入属性>兼容性,勾上以管理员身份运行
2.win10系统中搜索PowerShell,以管理员身份运行Windos PowerShell
3.打开后运行set-ExecutionPolicy RemoteSigned,然后更改权限为A
完成,需要重启VSCode