如何解决JSON输入的“意外结束”错误。运行NPM安装时
当我运行命令npm install
时,我将面临问题。错误输出如下所示。
npm verb stack SyntaxError: Unexpected end of JSON input while parsing near '...fines what it needs i'
npm verb stack at JSON.parse (<anonymous>)
npm verb stack at parseJson (/home/edy/.asdf/installs/nodejs/14.15.5/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
npm verb stack at /home/edy/.asdf/installs/nodejs/14.15.5/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50
npm verb stack at runMicrotasks (<anonymous>)
npm verb stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm verb cwd /home/edy/projects/godaddy/mercury
npm verb Linux 5.15.41-1-MANJARO
npm verb argv "/home/edy/.asdf/installs/nodejs/14.15.5/bin/node" "/home/edy/.asdf/installs/nodejs/14.15.5/bin/npm" "-dd" "install"
npm verb node v14.15.5
npm verb npm v6.14.11
npm ERR! Unexpected end of JSON input while parsing near '...fines what it needs i'
npm verb exit [ 1, true ]
基本上,该错误表示JSON输入在附近解析{此部分变化}'
。我尝试了一些事情来解决此问题,但没有任何效果。
我尝试清洁运行npm高速缓存清洁的高速缓存-force&amp;&amp; rm -rf〜/.npm
,并运行命令再次安装依赖项,但它不起作用。
关于如何解决这个问题有什么想法吗?感谢您的帮助。
节点版本:14.15.5
NPM版本:6.14.11
(我正在使用 asdf 来管理版本)
I'm facing an ISSUE when I run the command npm install
. The error output is shown below.
npm verb stack SyntaxError: Unexpected end of JSON input while parsing near '...fines what it needs i'
npm verb stack at JSON.parse (<anonymous>)
npm verb stack at parseJson (/home/edy/.asdf/installs/nodejs/14.15.5/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
npm verb stack at /home/edy/.asdf/installs/nodejs/14.15.5/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50
npm verb stack at runMicrotasks (<anonymous>)
npm verb stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
npm verb cwd /home/edy/projects/godaddy/mercury
npm verb Linux 5.15.41-1-MANJARO
npm verb argv "/home/edy/.asdf/installs/nodejs/14.15.5/bin/node" "/home/edy/.asdf/installs/nodejs/14.15.5/bin/npm" "-dd" "install"
npm verb node v14.15.5
npm verb npm v6.14.11
npm ERR! Unexpected end of JSON input while parsing near '...fines what it needs i'
npm verb exit [ 1, true ]
Basically, the error says JSON input while parsing near '{this part vary}'
. I tried some things to fix this but nothing worked.
I tried cleaning the cache running npm cache clean --force && rm -rf ~/.npm
, and running the command to install dependencies again but it didn't work.
Any idea on how to fix this? Thanks for any help.
Node Version: 14.15.5
NPM Version: 6.14.11
(I'm using asdf to manage the versions)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论