vue-cli安装出错问题

错误:PS C:\WINDOWS\system32> npm install vue-cli -g
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! code EINTEGRITY
npm ERR! sha1-psC74fOPOqC5Ijjstv9Cw0TUE10= integrity checksum failed when using sha1: wanted sha1-psC74fOPOqC5Ijjstv9Cw0TUE10= but got sha1-7Qoe24fAXU2xA3xfj0g9ijtfCCU=. (1518 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\nvmData\nvm\npm\node_cache\_logs\2018-09-01T04_10_13_466Z-debug.log

安装报错的原因是我在某一次安装的时候网络不好,没有下载完整某个 json 文件,但是 npm install 过程中又强行去读取 json 文件就报错了。清除npm缓存试试

有几个方式可以试试

  1. 已检过过node和npm版本的话,再检查下 vue-cli 的版本是否最新
  2. 其次检查eslint是否在全局node_modules进行了安排
  3. 可以对全局缓存做一次处理或者清理排查看看,哪些失效了
# 逐条试试
npm ls --depth 0 -g // 看看哪些失效了
npm prune -g // 修剪下全局包
npm rebuild -g // 重建下全局包
npm update -g // 更新下全局包的版本
npm cache clear --force -g // 删除全局包的缓存(慎重)

猜你喜欢

转载自blog.csdn.net/qq_38188485/article/details/82286072