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

When update to node 22, error: bcrypt_lib.node is not a valid Win32 application. #1055

Open
Pesya1 opened this issue Nov 5, 2024 · 1 comment

Comments

@Pesya1
Copy link

Pesya1 commented Nov 5, 2024

I have a node app, using "bcrypt": "^5.1.1",
It worked well, with node 20.17.0,
When I update node to 22.11.0, the app failed:

node:internal/modules/cjs/loader:1715 return process.dlopen(module, path.toNamespacedPath(filename)); ^ Error: \\?\D:\my_app\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node is not a valid Win32 application. \\?\D:\my_app\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node

I tried deleting node_modules and package-lock.json,
and run npm install,
The bcrypt installation fails, returning an error:

npm error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\my_user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\my_app\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\my_app\node_modules\bcrypt\lib\binding\napi-v3 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1) npm error node-pre-gyp ERR! stack at ChildProcess.<anonymous> (D:\my_app\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23) npm error node-pre-gyp ERR! stack at ChildProcess.emit (node:events:518:28) npm error node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1104:16) npm error node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5) npm error node-pre-gyp ERR! System Windows_NT 10.0.22621 npm error node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\my_app\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" npm error node-pre-gyp ERR! cwd D:\my_app\node_modules\bcrypt npm error node-pre-gyp ERR! node -v v22.11.0 npm error node-pre-gyp ERR! node-pre-gyp -v v1.0.11 npm error node-pre-gyp ERR! not ok

It seems that the library ran on 32bit, and was not supported by node 22.
How can the problem be solved?

@nkkky
Copy link

nkkky commented Nov 23, 2024

Happens not only on Windows but also on Linux.
Here in a virtual environment:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants