美文网首页
create-react-app 创建失败解决方案

create-react-app 创建失败解决方案

作者: 灬小白 | 来源:发表于2018-08-06 16:28 被阅读0次

报错如下:
npm ERR! Unexpected end of JSON input while parsing near '...AnZWagAAeJYP/1lo7dCj5'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-08-06T0
7_32_53_829Z-debug.log


报错文件.png

解决方案:
删除如下文档里面的文件,重新运行命令:

C:\Users\当前计算机用户名字\AppData\Roaming\npm-cache\


顺便说下,在执行create-react-app的时候,如果没有科学上网,一般情况下都不会太快,因为这个时候create-react-app指令默认调用npm,所以我们需要把npm的register永久给设置成cnpm,这样就可以一劳永逸了。

npm config set registry https://registry.npm.taobao.org
-- 配置后可通过下面方式来验证是否成功
npm config get registry
-- 或npm info express

相关文章

网友评论

      本文标题:create-react-app 创建失败解决方案

      本文链接:https://www.haomeiwen.com/subject/yrsgvftx.html