npm 安装失败,npm ERR!无效的 json 响应 [英] npm install failed, npm ERR! invalid json response

查看:88
本文介绍了npm 安装失败,npm ERR!无效的 json 响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

npm WARN ERESOLVE 覆盖对等依赖
npm WARN 发现:bootstrap@3.4.1
npm 警告 node_modules/@ivan/data-insights/node_modules/bootstrap
npm WARN 引导程序@^3.3.7";来自@ivan/data-insights@1.7.26
npm 警告 node_modules/@ivan/data-insights
npm 警告@ivan/data-insights@1.7.26";从根项目
npm 警告
npm WARN 无法解析依赖:
npm WARN peer bootstrap@^4.3.1";来自 bootstrap-switch@3.4.0
npm 警告 node_modules/@ivan/data-insights/node_modules/bootstrap-switch
npm WARN 引导开关@^3.4.0";来自@ivan/data-insights@1.7.26
npm 警告 node_modules/@ivan/data-insights
错误!代码 FETCH_ERROR
错误!错误号 FETCH_ERROR
错误!http://registry.npmjs.org/@babel%2fparser 处的 json 响应正文无效原因:JSON 中的意外标记 d 在位置 103148

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: bootstrap@3.4.1
npm WARN node_modules/@ivan/data-insights/node_modules/bootstrap
npm WARN bootstrap@"^3.3.7" from @ivan/data-insights@1.7.26
npm WARN node_modules/@ivan/data-insights
npm WARN @ivan/data-insights@"1.7.26" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer bootstrap@"^4.3.1" from bootstrap-switch@3.4.0
npm WARN node_modules/@ivan/data-insights/node_modules/bootstrap-switch
npm WARN bootstrap-switch@"^3.4.0" from @ivan/data-insights@1.7.26
npm WARN node_modules/@ivan/data-insights
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at http://registry.npmjs.org/@babel%2fparser reason: Unexpected token d in JSON at position 103148

推荐答案

我已经通过以下方式解决了这个问题:

I have already resolved this issue in the following way:

npm cache clean --force

npm cache verify

然后

npm i npm@latest -g

最后,我能够运行

npm i

有类似的问题:npm 错误!在 '...registry.npmjs.org/@i' 附近解析时 JSON 输入意外结束

这篇关于npm 安装失败,npm ERR!无效的 json 响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆