npm 安装依赖报错解决:npm ERR! Unexpected end of JSON input while parsing near

问题概述

公司里的Jenkins构建某个前端项目一直报错,查看日志发现是在 npm i 阶段,错误如下:

npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm ERR! Unexpected end of JSON input while parsing near '...RZ9vRZCK58maAT55SsyLT'

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/npm/node_cache/_logs/2020-06-22T09_56_13_966Z-debug.log

而在本地,或者其他机器上安装都是正常的,说明代码没问题,最后怀疑是npm的缓存,查询命令解决了问题

解救之法

清空npm的暂存

npm cache clean --force
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

东北小狐狸-Hellxz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值