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


未经允许不得转载:Web前端开发资源网 » npm安装typescript报错npm ERR! Unexpected end of JSON input while parsing near

推荐阅读:

Bootstrap里的文件分别代表什么意思及其引用方法

给Sublime增加代码格式化快捷键

Linux下如何重置MySQL密码

html中hr标签的基础知识

20180410博客更换服务器步骤

赞 (0)
分享到: +

评论 沙发

Avatar

换个身份

  • 昵称 (必填)
  • 邮箱 (选填)