安装vue脚手架报错

npm 安装vue脚手架报错

报错详情

npm ERR! Unexpected end of JSON input while parsing near '...TuHxXJaknDulF3AdSBoul'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersxxxAppDataRoaming
pm-cache\_logs2019-12-22T03_12_06_342Z-debug.log

最后解决方法

npm cache clean --force
npm i -g npm

不行再试一遍这些

npm ls --depth 0 -g // 看看哪些失效了
npm prune -g // 修剪下全局包
npm rebuild -g // 重建下全局包
npm update -g // 更新下全局包的版本
npm cache clear --force -g // 删除全局包的缓存(慎重)

 

幻想毫无价值,计划渺如尘埃,目标不可能达到。这一切的一切毫无意义——除非我们付诸行动。
原文地址:https://www.cnblogs.com/TodayWind/p/13531815.html