npm执行清理缓存失败

拉取2.x版本vue-cli时,执行npm install -g @vue/cli-init报错

npm ERR! code EINTEGRITY
npm ERR! sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw== integrity checksum failed when using sha512: wanted sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw== but got sha512-zkWjYRjE/LrLSc7sZ8sEeENtetdmYIoRLIOrjHPYMq26qRIrFzLQ+Y32NF9NTiHeSV8pAAmrJeb1hCSyO5AmOw==. (15740 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2020-04-09T14_44_57_948Z-debug.log

E:\visual_studio_file\vue\code\06day_Vue>npm cache clean –force
npm ERR! npm cache clear does not accept arguments

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2020-04-09T14_47_16_224Z-debug.log

发现是npm缓存出现问题,执行npm cache clean –force,清除失败报错

npm ERR! npm cache clear does not accept arguments

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2020-04-09T14_47_33_797Z-debug.log

发现我之前更新了npm版本(大于5),执行npm cache clear --force && npm install --no-shrinkwrap --update-binary,清除成功!

相关推荐
©️2020 CSDN 皮肤主题: 数字20 设计师:CSDN官方博客 返回首页