Reputation: 23
I am deploying my node app on gcp using gcloud app deploy
. I have installed gcloud sdk and now when i try to execute deploy command it is resulting in the following error:
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 [email protected] No description
Step #1: npm WARN [email protected] No repository field.
Step #1:
Step #1: npm ERR! code ELIFECYCLE
Step #1: npm ERR! errno 1
Step #1: npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
Step #1: npm ERR! Exit status 1
Step #1: npm ERR!
Step #1: npm ERR! Failed at the [email protected] install script.
It started with error of node-hid. I installed it with npm install --save node-hid
. And then it changed to the error mentioned.
Following is my 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"
}
}
And 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
Everything work fine on local environment but it produces error while deploying to the cloud.
Upvotes: 1
Views: 7173
Reputation: 959
I had similar issue (in MAC OS) caused by having locked package file in project folder so conflict was created. Try removing
package-lock.json
from project folder than initiate install again :
npm install
I hope that helped you too.
Upvotes: 1