GCP Build потерпел неудачу GYR ERR!Ошибка стека: `make` не выполнен с кодом выхода: 2 - PullRequest
0 голосов
/ 23 сентября 2019

Я развертываю приложение моего узла на gcp, используя gcloud app deploy.Я установил gcloud SDK и теперь, когда я пытаюсь выполнить команду deploy, это приводит к следующей ошибке:

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.

Это началось с ошибки node-hid.Я установил его с npm install --save node-hid.И затем это изменилось к упомянутой ошибке.

Следующее - мой package.json

{
  "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

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

Все отлично работает в локальной среде, новыдает ошибку при развертывании в облаке.

...