搭建vue环境时在npm install的时候出现C:\Users\叶子\AppData\Roaming\npm-cache\_logs\2018-07-25T08_10_51_673Z-debug.log报错
一、问题产生
我们使用命令 npm install xxx
安装包时,默认是从 npm 的的镜像源服务器进行下载的,由于该服务器是放在国外,很容易就导致安装失败。因此 我们需要修改镜像源地址。 全局安装nrm 镜源管理器 nrm里面存放了多个镜像服务器
npm install nrm -g
当像上面一样全局安装nrm时报错:
-
C:\WINDOWS\system32>npm i nrm -g
-
npm ERR! Unexpected end of JSON input while parsing near '...nflight":"~1.0.4","in'
-
npm ERR! A complete log of this run can be found in:
-
npm ERR! C:\Users\AppData\Roaming\npm-cache\_logs\2018-06-14T07_40_00_938Z-debug.log
二、问题解决
先清除缓存,再重新安装
- 清除缓存
npm cache clean --force
- 重新安装
npm install