繁体   English   中英

Firebase npm 安装错误

[英]Firebase npm install error

我在这里用 node.js 构建 firebase 示例

https://github.com/googlesamples/Firebase-Plays-GCP-2016

我的 Package.json 文件

 {
  "name": "game-control",
  "version": "1.0.0",
  "description": "Game controller to relay keystrokes",
  "main": "game-controller.js",
  "private": "true",
  "dependencies": {
    "chance": "^1.0.3",
    "firebase-admin": "4.1.2",
    "firebase-functions": "0.5.1",
    "gcloud": "^0.32.0",
    "prompt": "^1.0.0",
    "robotjs": "^0.3.7",
    "sleep": "^3.0.1"
  },
  "keywords": [
    "game",
    "controller",
    "keystrokes"
  ],
  "author": "Google Inc.",
  "contributors": [
    {
      "name": "Bret McGowen",
      "url": "https://twitter.com/bretmcg"
    }
  ],
  "license": "Apache-2.0"
}

npm install后出现错误 npm 错误日志如下 (/home/"username"/.npm/_logs/2017-12-07T14_31_17_723Z-debug.log)

12379 verbose lifecycle grpc@0.13.1~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bi..............

12380 verbose lifecycle grpc@0.13.1~install: CWD: /home/"username"/Firebase-Plays-GCP-2016/backend/game-controller/node_modules/grpc
12381 silly lifecycle grpc@0.13.1~install: Args: [ '-c', 'node-pre-gyp install --fallback-to-build' ]
12382 silly lifecycle grpc@0.13.1~install: Returned: code: 1  signal: null
12383 info lifecycle grpc@0.13.1~install: Failed to exec install script
12384 verbose unlock done using /home/"Username"/.npm/_locks/staging-6598b7ab8d64c375.lock for /home/"Username"/Firebase-Plays-GCP-2016/backend/game-controller/node_modules/.staging
12385 verbose stack Error: grpc@0.13.1 install: `node-pre-gyp install --fallback-to-build`
12385 verbose stack Exit status 1
12385 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
12385 verbose stack     at emitTwo (events.js:126:13)
12385 verbose stack     at EventEmitter.emit (events.js:214:7)
12385 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
12385 verbose stack     at emitTwo (events.js:126:13)
12385 verbose stack     at ChildProcess.emit (events.js:214:7)
12385 verbose stack     at maybeClose (internal/child_process.js:925:16)
12385 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
12386 verbose pkgid grpc@0.13.1
12387 verbose cwd /home/"Username"/Firebase-Plays-GCP-2016/backend/game-controller
12388 verbose Linux 4.10.0-40-generic
12389 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
12390 verbose node v8.9.2
12391 verbose npm  v5.5.1
12392 error code ELIFECYCLE
12393 error errno 1
12394 error grpc@0.13.1 install: `node-pre-gyp install --fallback-to-build`

我是node.js、firebase新手,我的节点版本:v8.9.2、npm版本:5.5.1

提前致谢

我有同样的问题,我通过命令解决了它

npm cache clean --force

对我来说,它只是运行命令:

npm install -g firebase-tools

具有超级用户权限或通过执行此命令:

sudo -s

我遇到了同样的问题,并按如下方式解决。 我安装了

npm install -g firebase@4.6.2

并在 firebase 版本之前删除了 package.json 中的 cap ^。

我遇到了同样的问题并按如下方式解决了它。 我安装了

npm install --save firebase

一堆这些模块已经过时了,所以我更新了后端依赖项。 请参阅此拉取请求:https ://github.com/googlesamples/Firebase-Plays-GCP-2016/pull/1

我能够在 Mac OS X 10.12 和 Windows Server 2016 上使用这些更新安装 npm。

我用这个命令来避免这个问题

npm install firebase --force

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM