报错如下:
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

解决方案:
删除如下文档里面的文件,重新运行命令:
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
网友评论