我刚刚开始我的编码之旅,我刚刚开始使用react,但是当我尝试创建一个新的应用程序时,我得到了以下错误。它显示JSON输入意外结束。
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...gin-precompile-
charco'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vaibh\AppData\Roaming\npm-cache\_logs\2018-07-
24T07_21_16_208Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-
scripts has failed.
Deleting generated file... package.json
Deleting robofriends / from C:\Users\vaibh\Desktop
Done.发布于 2018-07-24 15:40:41
这是由于npm缓存造成的。
您可以通过以下方法解决此问题:
npm cache clean --force另外,确保您的npm更新到最新版本。
npm i npm@latest -g然后重试!!
https://stackoverflow.com/questions/51493003
复制相似问题