npm安装typescript报错npm ERR! Unexpected end of JSON input while parsing near

今天再在安装 typescript 时一直没有进度,我就切换了一下网络,联通改成移动。

再次执行 npm install -g typescript 时报错:

npm ERR! Unexpected end of JSON input while parsing near '...PbBsonLiCvTo6MV+pcV1D'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:/Users/Deshun/AppData/Roaming/npm-cache/_logs/2020-12-11T01_...-debug.log

解决方法:

1、清除 cache 

npm cache clean --force

2、不要使用淘宝镜像,切换为 npm 官方镜像

npm cache clean --force

未经允许不得转载:w3h5 » npm安装typescript报错npm ERR! Unexpected end of JSON input while parsing near

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/150505.html

(0)
上一篇 2021年9月13日
下一篇 2021年9月13日

相关推荐

发表回复

登录后才能评论