码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2020-06-22 19:35:07      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:清空   问题   node   The   机器   bash   cte   pac   jenkins   

问题概述

公司里的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

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

标签:清空   问题   node   The   机器   bash   cte   pac   jenkins   

原文地址:https://www.cnblogs.com/hellxz/p/13178246.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!