【问题标题】:npm install failed, npm ERR! invalid json responsenpm 安装失败,npm 错误!无效的 json 响应
【发布时间】:2021-09-23 16:24:10
【问题描述】:

npm WARN ERESOLVE 覆盖对等依赖
发现 npm 警告:bootstrap@3.4.1
npm WARN node_modules/@ivan/data-insights/node_modules/bootstrap
npm WARN bootstrap@"^3.3.7" 来自@ivan/data-insights@1.7.26
npm WARN node_modules/@ivan/data-insights
来自根项目的 npm WARN @ivan/data-insights@"1.7.26"
npm 警告
npm WARN 无法解析依赖:
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" 来自@ivan/data-insights@1.7.26
npm WARN node_modules/@ivan/data-insights
npm 错误!代码 FETCH_ERROR
npm 错误!错误号 FETCH_ERROR
npm 错误! http://registry.npmjs.org/@babel%2fparser 处的无效 json 响应正文原因:JSON 中位置 103148 处的意外标记 d

【问题讨论】:

  • 我解决了这个:npm cache clean --forcenpm cache verify 然后npm i npm@latest -g 最后,我成功运行了npm i

标签: node.js vue.js npm webpack


【解决方案1】:

错误是说您的项目中已经存在一个引导程序版本。尝试删除引导程序并重新安装。或删除 node_modules 并再次运行 npm install 以安装您的软件包。

【讨论】:

  • 没有什么要删除的,还没有任何节点模块
【解决方案2】:

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

npm cache clean --force

npm cache verify

然后

npm i npm@latest -g

最后,我能跑了

npm i

有类似的问题:npm ERR! Unexpected end of JSON input while parsing near '...registry.npmjs.org/@i'

【讨论】:

    猜你喜欢
    • 2022-11-20
    • 1970-01-01
    • 2021-03-10
    • 1970-01-01
    • 2013-09-15
    • 2020-11-28
    • 2015-06-15
    • 2017-02-04
    相关资源
    最近更新 更多