chrisa / node-dtrace-provider

Native DTrace probes for node.js apps
Other
319 stars 70 forks source link

failed installation exits with 0 #124

Open anton-yurchenko opened 5 years ago

anton-yurchenko commented 5 years ago

Hey, The errors are suppressed, so in case there is a missing dependency for the installation, npm install dtrace-provider exits with code 0 and allows to continue. If used in CI pipe, it might create broken artifacts if not tested properly.

Here is an installation log on docker image node:10-alpine:

/opt/app # npm install dtrace-provider

> dtrace-provider@0.8.7 install /opt/app/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Linux 4.9.93-linuxkit-aufs
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/app/node_modules/dtrace-provider
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ dtrace-provider@0.8.7
added 960 packages from 609 contributors and audited 25030 packages in 22.076s
found 9 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
/opt/app # echo $?
0

Following suppress-error.js and setting environmental variable: export NODE_DTRACE_PROVIDER_REQUIRE="hard" does not solves the issue

vweevers commented 5 years ago

Setting environmental variable: export NODE_DTRACE_PROVIDER_REQUIRE="hard" does not solves the issue

I suspect that's because bunyan has dtrace-provider listed an an optionalDependency, so the exit code of node-gyp rebuild || node suppress-error.js is always ignored by npm.

juangamnik commented 4 years ago

This is still an issue. I get this error, too.

Bx-T commented 2 years ago

Same