Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prebuild-install fails to determine target on Node 23.6.0 #203

Open
baileympearson opened this issue Jan 13, 2025 · 1 comment · May be fixed by #204
Open

prebuild-install fails to determine target on Node 23.6.0 #203

baileympearson opened this issue Jan 13, 2025 · 1 comment · May be fixed by #204
Labels
pull request welcome A pull request is welcome

Comments

@baileympearson
Copy link

baileympearson commented Jan 13, 2025

On the latest node (23.6.0), prebuild-install fails to install native packages that specify napi versions in the package.json (and maybe other configurations too) - prebuild-install reports a target of undefined. Ex:

$ npm i @mongodb-js/zstd
npm error code 127
npm error path /~/dev/mongoose/node_modules/@mongodb-js/zstd
npm error command failed
npm error command sh -c prebuild-install --runtime napi || npm run clean-install
npm error > @mongodb-js/[email protected] clean-install
npm error > npm run install-zstd && npm run compile
npm error
npm error
npm error > @mongodb-js/[email protected] install-zstd
npm error > bash etc/install-zstd.sh
npm error prebuild-install warn This package does not support N-API version undefined
npm error prebuild-install warn install No prebuilt binaries found (target=undefined runtime=napi arch=arm64 libc= platform=darwin)
npm error bash: etc/install-zstd.sh: No such file or directory
npm error A complete log of this run can be found in: /~/.npm/_logs/2025-01-13T16_59_21_577Z-debug-0.log

(note: we realize that this package should be buildable from source, we plan to fix this separately).

Notice that the inferred target is undefined:

target=undefined runtime=napi arch=arm64 libc= platform=darwin)

This behavior is not present on Node versions <23.6.0.

The bug actually lies in napi-build-utils (I filed inspiredware/napi-build-utils#6 too) but that package seems long dead, so I'm filing an issue here as well.

The root cause is that 23.6.0 increased the napi version to 10, which breaks the logic in getBestNapiBuildVersion(), which uses string comparison instead of numeric comparison.

@jschlight
Copy link
Contributor

jschlight commented Jan 17, 2025

This issue should now be addressed in inspiredware/napi-build-utils 2.0.0.

@vweevers vweevers added the pull request welcome A pull request is welcome label Jan 17, 2025
@baileympearson baileympearson linked a pull request Jan 17, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull request welcome A pull request is welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants