0%

Vue CLI安装报错

执行npm install -g @vue/cli安装报错,错误信息如下:

1
2
3
4
5
6
7
8
Hu-YupingdeMacBook-Pro:~ kris$ npm install -g @vue/cli
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kris/.npm/_logs/2020-03-14T22_56_23_922Z-debug.log

解决办法,切换网络,清除npm缓存,执行命令:npm cache clean --force

参考链接

npm install 的时候 出现 unexpected end of file的问题