【报错】react 使用npx create-react-app
2020-03-27 本文已影响0人
suesoft
使用官方步骤npx create-react-app my-app
创建React App,无文件夹my-app生成,且报错
Installing react, react-dom, and react-scripts width cra-template...
npm ERR! Unexpected end of JSON input while parsing near ...ps://registry.npm.js.o’
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administratore\AppData\Roaming\npm-cache_logs\2020-03-25T02_54_03_429Z-debug.log
...
1585106680.jpg
切换为淘宝镜像再次运行就ok 了,如下:
//切换为淘宝源
npm config set registry https://registry.npm.taobao.org
// 验证是否配置成功
npm config get registry
// 重新创建
npx create-react-app my-app
![](https://img.haomeiwen.com/i8054322/6d66b0cd62e82d69.jpg)