首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GCP构建失败的GCP错误!堆栈错误:` `make`‘退出代码失败:2

GCP构建失败的GCP错误!堆栈错误:` `make`‘退出代码失败:2
EN

Stack Overflow用户
提问于 2019-09-23 12:25:17
回答 1查看 6.2K关注 0票数 1

我正在使用gcloud app deploy在gcp上部署我的节点应用程序。我已经安装了gcloud,现在当我尝试执行部署命令时,它会导致以下错误:

代码语言:javascript
复制
Step #1: prebuild-install WARN install libusb-1.0.so.0: cannot open shared object file: No such file or directory
Step #1: make: Entering directory '/app/node_modules/node-hid/build'
Step #1: ../hidapi/linux/hid.c:44:21: fatal error: libudev.h: No such file or directory
Step #1: compilation terminated.
Step #1: hidapi-linux-hidraw.target.mk:101: recipe for target 'Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o' failed
Step #1: make: *** [Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o] Error 1
Step #1: make: Leaving directory '/app/node_modules/node-hid/build'
Step #1: gyp ERR! build error 
Step #1: gyp ERR! stack Error: `make` failed with exit code: 2
Step #1: gyp ERR! stack     at ChildProcess.onExit (/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
Step #1: gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
Step #1: gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
Step #1: gyp ERR! System Linux 4.15.0-1044-gcp
Step #1: gyp ERR! command "/nodejs/bin/node" "/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
Step #1: gyp ERR! cwd /app/node_modules/node-hid
Step #1: gyp ERR! node -v v10.16.1
Step #1: gyp ERR! node-gyp -v v3.8.0
Step #1: gyp ERR! not ok 
Step #1: npm WARN bridge@1.0.0 No description
Step #1: npm WARN bridge@1.0.0 No repository field.
Step #1: 
Step #1: npm ERR! code ELIFECYCLE
Step #1: npm ERR! errno 1
Step #1: npm ERR! node-hid@0.7.9 install: `prebuild-install || node-gyp rebuild`
Step #1: npm ERR! Exit status 1
Step #1: npm ERR! 
Step #1: npm ERR! Failed at the node-hid@0.7.9 install script.

从节点hid的错误开始。我用npm install --save node-hid安装了它。然后它变成了提到的错误。

以下是我的package.json

代码语言:javascript
复制
{
  "name": "bridge",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node app.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "engines": {
    "node": "10.16.3"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@binance-chain/javascript-sdk": "^2.14.8",
    "axios": "^0.19.0",
    "bignumber.js": "^5.0.0",
    "bip39": "^3.0.2",
    "body-parser": "^1.19.0",
    "compression": "^1.7.4",
    "cors": "^2.8.5",
    "crypto": "^1.0.1",
    "crypto-browserify": "^3.12.0",
    "express": "^4.17.1",
    "generate-password": "^1.4.2",
    "helmet": "^3.21.0",
    "mongoose": "^5.6.11",
    "node-fetch": "^2.6.0",
    "node-hid": "^0.7.9",
    "nodemailer": "^6.3.0",
    "prebuild-install": "^5.3.2",
    "react": "^16.9.0",
    "sha256": "^0.2.0",
    "web3": "^1.2.1"
  }
}

app.yaml

代码语言:javascript
复制
runtime: nodejs
env: flex

# manual_scaling:
#   instances: 1

# resources:
#   cpu: .5
#   memory_gb: 0.5
#   disk_size_gb: 10

# handlers:
#   -url: /
#     static_files: client/build/index.html
#     upload: client/build/index.html
#   -url: /
#     static_dir: client/build

在本地环境中,一切都很好,但是它在部署到云时会产生错误。

EN

回答 1

Stack Overflow用户

发布于 2020-02-03 19:16:24

我也有过类似的问题(在MAC操作系统中),因为我在项目文件夹中锁定了包文件,所以产生了冲突。尝试移除

package-lock.json

从项目文件夹中再次启动安装:

代码语言:javascript
复制
npm install

我希望这也能帮到你。

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

https://stackoverflow.com/questions/58062398

复制
相关文章

相似问题

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