无法执行"npm install --save firebase" [英] Unable to do "npm install --save firebase"
问题描述
直到昨天早上我一直在使用firebase,然后突然在下午"npm install --save firebase"因错误而停止工作:
I have used firebase right up to yesterday morning, then suddenly in the afternoon "npm install --save firebase" stopped working with the error:
npm ERR!解析附近时JSON输入意外结束'... anary.9678bf9.tgz","f"
npm ERR! Unexpected end of JSON input while parsing near '...anary.9678bf9.tgz","f'
npm ERR!可以在以下位置找到此运行的完整日志:
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\manjot\AppData\Roaming\npm-cache_logs\2019-11-04T05_47_36_550Z-debug.log
我已经尝试将node.js从10更新到13.0.1,卸载并安装,清除缓存,重新启动计算机,一个新项目,使用admin cmd进行所有这些操作,谷歌搜索了一下,但到目前为止还没有运气.为什么突然停止工作?如何解决此问题?我仍然可以做
I've tried updating my node.js from 10 to 13.0.1, uninstalling and installing, clearing cache, restarting my computer, a new project, doing all of this with admin cmd, googled a bit but no luck so far. Why did it suddenly stop working and how to fix this issue? I can still do things like
"npm install --save react-navigation"
"npm install --save react-navigation"
或
"npm install --save react-navigation-stack"
"npm install --save react-navigation-stack"
推荐答案
好像最新发布的firebase npm模块版本已损坏,npm无法解析tgz文件以获取lib.如果是我,我会去看看他们的发行页面,查找您知道可以使用的先前版本并安装该版本.
Looks like the latest released version of firebase npm module is corrupted somehow and npm is failing to parse the tgz file for the lib. If it was me I would go and look at their releases page look for a previous version you know works and install that version.
npm install firebase@x.y.z
我还要说,请确保使用 package-lock.json
文件锁定模块的工作版本.
I would also say, be sure to use a package-lock.json
file to lock down working versions of modules.
这篇关于无法执行"npm install --save firebase"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!