【问题标题】:unexpected end of json input react [duplicate]json输入意外结束反应[重复]
【发布时间】:2018-12-31 17:52:03
【问题描述】:

我刚刚开始我的编码之旅,我刚刚开始使用 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.

【问题讨论】:

标签: javascript reactjs npm


【解决方案1】:

这是由于 npm 缓存。

您可以通过以下方式解决:

npm cache clean --force

另外,请确保您的 npm 已更新到最新版本。

npm i npm@latest -g

再试一次!!

【讨论】:

  • 谢谢,但对我不起作用:(
猜你喜欢
  • 1970-01-01
  • 2020-07-29
  • 2022-01-22
  • 1970-01-01
  • 2020-07-10
  • 1970-01-01
  • 2015-08-05
  • 2019-10-19
  • 2015-03-15
相关资源
最近更新 更多