-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Error: NJS-045: cannot load a node-oracledb binary for Node.js 12.0.0 (win32 x64) #1091
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
Comments
Since you're on Windows, my recommendation is to use Node 10 or 11. The alternative is to compile the module yourself. It's likely only the 4.0-dev version will compile, see #1085 |
Sorry, I'm new with node. What do you mean by "compile the module yourself"? About the links you sent I followed the instructions but still without success. I can connect in oracle and execute queries, my problem happens only when I am working with electron. |
Use Node 10, which I see in your first post you had/have around. That has a prebuilt node-oracledb binary. But if you need Node 12 you will have to build node-oracledb from source code using the branch I gave. Install instructions for building from source code are at https://oracle.github.io/node-oracledb/INSTALL.html#githubtags |
Still giving error... Below the steps I used Simple App Electron App I tried following the link instructions: npm install -S oracle/node-oracledb#v3.1.2 |
If the message says you're using Node.js 12, then you're using Node.js 12. Electron has its own special issues, since the V8 engine isn't exactly the same as the Node.js one that our binaries are built with. See #918 for some Electron help. |
When will you offer a pre-compiled binary for node 12? |
I Solved the problem using
after installing the dependencies run |
@max-pub precompile binaries will be available when node-oracledb 4 is released and 12 has bedded down a bit. Please help speed up the node-oracledb release process by testing v4, see #1053 @victorgianvechio that's great. |
I'm experiencing this on a Windows and Linux machine
I've double-checked and Node.js 12.0.0 is NOT installed on the Windows machine or Linux machine.
I've tried rebuilding from source with electron-rebuild. Same results. It's as if some dependency is specifying Node.js 12.0.0 |
@tonydiep If NJS-045 is saying you have Node 12, then that is what your Node is identifying itself as. I know Electron is 'special'. I'm surprised electron-rebuild isn't helping. Here is what I'd suggest: (i) trying the dev-4.0 branch, see #1053. There is even a binary available (ii) installing Node 12 and compiling. |
@victorgianvechio thanks for sharing the tip and the app. Have you tried it with the dev-4.0 code?
|
@victorgianvechio Thanks for advice. Unfortunately I still get the same error after deleting node_modules and reinstalling fresh dependencies and dev-4.0. |
@tonydiep do some debugging and see what exactly is being loaded by what. |
@cjbj i tried it now and worked without using electron-rebuild, great!!! see package.json @tonydiep have you deleted package-lock.json before running npm install? iam using
I updated my app with node-oracledb#dev-4.0, test it and see if the error still continues.
After cloning just run:
|
@tonydiep be sure if you have node-gyp installed globally
iam using [email protected]
|
Although the solution sucks ... in locate the line with oracledbCLib = require(binaryLocations[i]); and replace it with
|
|
@Raks25 this is a closed issue. Search for previous questions on Electron and look at things like electron-rebuild. If you still have problems, please open a new issue. |
Try to use ES module, change the file .js to .mjs, and using require instead of import. It works for me, I think node-oracledb is ESM now. |
thanks @cjbj. It worked for me. 👍 |
I am developing an academic project with electron and oracle. My dbConnection.js file connects to the database and returns a success or error message.
When I run 'node dbConnection.js' the success message appears.
When I try to call the connection method in the electron application I get the following error: Error: NJS-045: Can not load a node-oracledb binary for Node.js 12.0.0 (win32 x64).
Windows 10 x64
Node v10.15.3
Oracle 11G
Phyton 3.7.3
VC Redist 2005/2013/2015/2019 (all these versions installed)
Any ideas how to solve the problem?
The text was updated successfully, but these errors were encountered: