npm install报错之解决方法

npm install时报错如下图所示:

D:\Vue\demo>npm install
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm ERR! Unexpected end of JSON input while parsing near '...babel-core":"^4.7.0",'

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\nodejs\node_cache\_logs\2019-02-24T12_13_10_483Z-debug.log

D:\Vue\demo>npm ERR! Unexpected end of JSON input while parsing near '...babel-core":"^4.7.0",'

解决方法:

先清除cache,再重新安装

npm cache clean --force

 

你可能感兴趣的:(Vue)