运行npm install时JSON输入意外结束 [英] Unexpected end of JSON input while run npm install

查看:111
本文介绍了运行npm install时JSON输入意外结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像这样安装 eslint npm软件包时

While installing the eslint npm package like this

npm i eslint -g

我遇到以下错误:

npm ERR!解析'..."coveralls":"2.11.4",'

npm ERR! Unexpected end of JSON input while parsing near '..."coveralls":"2.11.4",'

我该如何解决?

推荐答案

请按照以下步骤操作:

方法1:

1..清理缓存

npm cache clean --force

2..然后安装最新的角度cli:

2. Then install latest angular cli:

npm install -g @angular/cli@latest

3..然后安装您的软件包

3. Then install your package

npm install -g eslint

方法2:

1..卸载 nodejs

2.通过以下命令清除缓存: npm cache clean --force

2. Clear cache by this command: npm cache clean --force

3.删除 package-lock.json 和节点 node_modules 文件夹

4..安装 nodejs 最新版本

5..安装最新的cli cli npm install -g @ angular/cli @ latest .

5. Install latest angular cli npm install -g @angular/cli@latest.

6..运行 npm install .

7..安装所需的软件包.

7. Install your desired package that you wants.

希望它可以解决您的问题.如果没有,请通知我.通常,在大多数情况下,如果方法1不起作用,方法1就会起作用,请转到第二种方法.谢谢

Hope it resolve your issue.If not then please let me know.Generally,In most of the cases method 1 works if method 1 not works go for 2nd method. Thanks

这篇关于运行npm install时JSON输入意外结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆