npm ERR! Unexpected end of JSON input while

时间:2026-02-17 04:29:08

1、今天用npm编译时候报错:

C:\Users\king\vue-devtools>npm install

npm ERR! Unexpected end of JSON input while parsing near '...0.0","stream-to-obser'

npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\king\AppData\Roaming\npm-cache\_logs\2018-10-28T02_27_43_867Z-debug.log

通过查找归纳,找到解决办法

npm ERR! Unexpected end of JSON input while

2、首先清除npm编译的一些缓存,使用命令:

npm cache clean --force

npm ERR! Unexpected end of JSON input while

3、接下来,重新编译需要编译的包

npm install

编译成功:如下所示,接下来我们就可以用我们的编译包了

npm ERR! Unexpected end of JSON input while

npm ERR! Unexpected end of JSON input while

4、如果还是不能编译成功,那么最好重新安装配置下node.js,node.js  windows版本可以到官网下载直接安装,如下图所示,我的是windows64位所以下载64位的,下载完成,直接安装即可

npm ERR! Unexpected end of JSON input while

© 2026 长短途
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com