按照官方文档安装create-react-app后,执行npx create-react-app后报错:

Unexpected end of JSON input while parsing near ......

create-react-app 报错 Unexpected end of JSON input while parsing near '

执行下面命令可解决

npm cache clean --force ,

:执行后可以用以下命令检查

npm cache verify

如果还是不行,查看一下npm版本,不是最新的更新一下: 

npm i -g npm

再有就是试一下换npm的镜像服务器(实测,这个也不行)

npm config set registry http://registry.cnpmjs.org
或(这个是原始服务器)
npm config set registry http://registry.npmjs.org
或(实测国内最快)
npm config set registry https://registry.npm.taobao.org

 最后项目创建成功:

create-react-app 报错 Unexpected end of JSON input while parsing near '

相关文章: