按照官方文档安装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 '

相关文章:

  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2021-12-19
  • 2021-09-29
  • 2021-08-25
  • 2022-12-23
猜你喜欢
  • 2022-01-13
  • 2021-09-30
  • 2021-11-03
  • 2021-08-08
  • 2021-04-30
  • 2021-08-28
相关资源
相似解决方案