首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装防火墙- npm在MacOSX10.12.6上安装工具(错误:在解析“...x”、“firebase”:“~1.0.1”时意外结束JSON输入)

无法安装防火墙- npm在MacOSX10.12.6上安装工具(错误:在解析“...x”、“firebase”:“~1.0.1”时意外结束JSON输入)
EN

Stack Overflow用户
提问于 2018-09-08 05:45:09
回答 1查看 616关注 0票数 0

我目前正在使用节点10.10.0版NPMVersion6.4.1试图安装firebase,以便为已经创建的firebase项目处理云功能。它在其他系统上运行良好,但无法在我的MAC上安装防火墙工具。我也安装了一个新版本的节点,希望得到纠正错误,但它没有帮助。我也尝试使用'sudo‘和’-force‘与npm一起安装,但也没有帮助。这是我得到的错误的完整日志。请帮助这里是错误日志

代码语言:javascript
复制
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/10.10.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'firebase-tools' ]
2 info using npm@6.4.1
3 info using node@v10.10.0
4 verbose npm-session 402be1d1b21d5c2d
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/firebase-tools 297ms (from cache)
8 silly fetchPackageMetaData error for firebase-tools@latest Unexpected end of JSON input while parsing near '...x","firebase":"~1.0.1'
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 477ms
11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...x","firebase":"~1.0.1'
11 verbose stack     at JSON.parse (<anonymous>)
11 verbose stack     at parseJson (/usr/local/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
11 verbose stack     at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50)
11 verbose stack     at process._tickCallback (internal/process/next_tick.js:68:7)
12 verbose cwd /Users/techienimi
13 verbose Darwin 16.7.0
14 verbose argv "/usr/local/Cellar/node/10.10.0/bin/node" "/usr/local/bin/npm" "install" "-g" "firebase-tools"
15 verbose node v10.10.0
16 verbose npm  v6.4.1
17 error Unexpected end of JSON input while parsing near '...x","firebase":"~1.0.1'
18 verbose exit [ 1, true ]
EN

回答 1

Stack Overflow用户

发布于 2018-09-08 16:16:43

根据这些行文:

代码语言:javascript
复制
7 http fetch GET 304 https://registry.npmjs.org/firebase-tools 297ms (from cache)
8 silly fetchPackageMetaData error for firebase-tools@latest Unexpected end of JSON input while parsing near '...x","firebase":"~1.0.1'

听起来你的npm缓存可能已经损坏了。尝试删除主目录中的目录.npm来重置它。

或者,你可以尝试运行一个命令来重置缓存

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52232408

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档