node-gyp-build icon indicating copy to clipboard operation
node-gyp-build copied to clipboard

Report more information when a prebuild is not found

Open aminya opened this issue 3 years ago • 6 comments

Currently, it is quite hard to understand why a prebuild is not picked up, especially when the log comes from the end user. I think adding a console.log that includes some information like the host's platform, architecture, libc, etc. will help debug the issues.

aminya avatar Nov 18 '22 20:11 aminya

We already do:

https://github.com/prebuild/node-gyp-build/blob/0078d7884dfeb0e708477b3e20bfc4f520c1e2f8/index.js#L47-L60

vweevers avatar Nov 18 '22 20:11 vweevers

This is not happening when people run npm i. Some examples. See the logs.

https://github.com/zeromq/zeromq.js/issues/526 https://github.com/zeromq/zeromq.js/issues/530#issue-1455476760

aminya avatar Nov 18 '22 20:11 aminya

I would guess because of https://github.com/zeromq/zeromq.js/blob/dd72eed5835e321e5c728959744e08f093557beb/package.json#L73 (the additional steps before node-gyp-build).

vweevers avatar Nov 18 '22 20:11 vweevers

I added those just right now, and it is not released yet. Those reports are older.

aminya avatar Nov 18 '22 20:11 aminya

OK, may need npm i --verbose then. I don't recall.

vweevers avatar Nov 18 '22 20:11 vweevers

Looking at the code, the code path is not clear to me. A lot of old-style JS dynamism and prototype assignment is used. Using TypeScript could make it easier to find the reason. Where is the call site of the load function?

https://github.com/prebuild/node-gyp-build/blob/0078d7884dfeb0e708477b3e20bfc4f520c1e2f8/index.js#L18-L25

I also see some ignored error variables.

https://github.com/prebuild/node-gyp-build/blob/0078d7884dfeb0e708477b3e20bfc4f520c1e2f8/bin.js#L9

aminya avatar Nov 18 '22 20:11 aminya