【问题标题】:Cannot Install FIREBASE via NPM GLOBALLY (Error 127)无法通过 NPM 全局安装 FIREBASE(错误 127)
【发布时间】:2021-11-21 17:12:25
【问题描述】:

我无法通过 npm install -g firebase 安装 firebase。 我收到以下错误,我找不到解决方案:

这个问题似乎与 core-js 和 protobufjs 相关,它们不能是 postinstall。

注意:我确实已经多次重新安装 node.js - 没有任何运气。

51 http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 374ms
52 timing auditReport:getReport Completed in 377ms
53 silly audit report {}
54 timing auditReport:init Completed in 0ms
55 timing reify:audit Completed in 377ms
56 timing reifyNode:node_modules/@firebase/polyfill/node_modules/core-js Completed in 1368ms
57 timing reifyNode:node_modules/core-js Completed in 1470ms
58 timing reify:unpack Completed in 1470ms
59 timing reify:unretire Completed in 0ms
60 timing build:queue Completed in 1ms
61 info run core-js@3.18.1 postinstall node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
62 info run core-js@3.6.5 postinstall node_modules/@firebase/polyfill/node_modules/core-js node -e "try{require('./postinstall')}catch(e){}"
63 info run core-js@3.18.1 postinstall { code: 127, signal: null }
64 info run core-js@3.6.5 postinstall { code: 127, signal: null }
65 timing reify:rollback:createSparse Completed in 338ms
66 timing reify:rollback:retireShallow Completed in 31ms
67 timing command:install Completed in 2501ms
68 verbose stack Error: command failed
68 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs2\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
68 verbose stack     at ChildProcess.emit (node:events:390:28)
68 verbose stack     at maybeClose (node:internal/child_process:1064:16)
68 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
69 verbose pkgid core-js@3.18.1
70 verbose cwd C:\Users\chmit_000
71 verbose Windows_NT 10.0.19042
72 verbose argv "C:\\Program Files\\nodejs2\\node.exe" "C:\\Program Files\\nodejs2\\node_modules\\npm\\bin\\npm-cli.js" "install" "core-js"
73 verbose node v16.10.0
74 verbose npm  v7.24.0
75 error code 127
76 error path C:\Users\chmit_000\node_modules\core-js
77 error command failed
78 error command bash -c node -e "try{require('./postinstall')}catch(e){}"
79 error /bin/bash: node: command not found
80 verbose exit 127

【问题讨论】:

    标签: node.js firebase npm


    【解决方案1】:

    用于全局安装的包是firebase-tools。这是用于将您的应用程序(或其中的一部分)部署到 firebase 以及执行其他管理任务的 CLI。 firebase 包是用于在 Web/移动项目中访问 Firebase 后端/云功能的库。

    如果您要安装 CLI,请运行 npm install -g firebase-tools

    以下是两个包的链接:

    firebase

    firebase-tools

    【讨论】:

    • 很遗憾出现同样的错误:
    • 这可能是 PATH 问题。你在使用 NVM 吗?
    • 你是对的,这是/现在是路径问题。安装后出现问题。问题是我很久以前安装的“git bash”。将 git bash 添加到环境变量中解决了这个问题。
    猜你喜欢
    • 2020-10-23
    • 2015-03-25
    • 2019-05-20
    • 1970-01-01
    • 2020-12-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-07
    • 1970-01-01
    相关资源
    最近更新 更多