Node-oracledb: oracledb can't require the build version

Created on 24 Nov 2015  路  14Comments  路  Source: oracle/node-oracledb

Hi,

I'm having a problem requiring the oracledb in my app. I've successfully installed it on windows, and when i try to require it in my app.js:

var oracle = require('oracledb');

I get the following error:

C:\Users\pjaworski\Documents\Node\xsell3\node_modules\oracledb\lib\oracledb.js:28
    throw err;
    ^

Error: Nie mo鈹攼na odnale鈹嶁敎沤 okre鈹onego modu鈹攤u.
\\?\C:\Users\pjaworski\Documents\Node\xsell3\node_modules\oracledb\build\Release\oracledb.node
    at Error (native)
    at Object.Module._extensions..node (module.js:460:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\pjaworski\Documents\Node\xsell3\node_modules\oracledb\lib\oracledb.js:23:15)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\pjaworski\Documents\Node\xsell3\node_modules\oracledb\index.js:1:80)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

Requiring the oracledb.node file directly from the build/Release directory also does no good. I'm running node v4.2.1.

Best regards,
Piotr

install & configuration

Most helpful comment

Seems to be a problem with path ...

  • downgrade to 4.2 version of node.js
  • checked the filesystem
  • change path _C:\Devnodejs\driver\instantclient_12_1\sdk\include_ to _C:\oracle\instantclient_\sdk\include
  • put the 'C:\oracle\instantclient' at the beginning of the path
    -> Error solved.

Thx !

All 14 comments

Does PATH contain the Oracle client libraries (e.g. Instant Client)?

Yes, at the very beggining of my PATH:

%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\oracle\instantclient\sdk\include;C:\oracle\instantclient\sdk\lib\msvc;
C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Progr

Did you build it on the machine you are running on?

To go back to basics, how are you sure it built OK? (It looks ok, but always worth checking since I can't see your screen). Did you try to run it in the shell that it was built in, immediately after building?

How did you install it - with -g?

BTW, the Instant Client include dir doesn't need to be in PATH.

Same problem...

C:\Dev\Java\ProjectBis\ORATEST>npm install oracledb

[email protected] install C:\Dev\Java\ProjectBis\ORATESTnode_modules\oracledb
node-gyp rebuild

C:\Dev\Java\ProjectBis\ORATESTnode_modules\oracledb>if not defined npm_config_node_gyp (node "C:\Devnodejsnode_modules\npm\binnode-gyp-bin..\
G茅n茅ration des projets individuellement dans cette solution. Pour activer la g茅n茅ration en parall猫le, ajoutez le commutateur "/m".
njsOracle.cpp
njsPool.cpp
njsConnection.cpp
njsResultSet.cpp
njsMessages.cpp
njsIntLob.cpp
dpiEnv.cpp
dpiEnvImpl.cpp
dpiException.cpp
dpiExceptionImpl.cpp
dpiConnImpl.cpp
dpiDateTimeArrayImpl.cpp
dpiPoolImpl.cpp
dpiStmtImpl.cpp
dpiUtils.cpp
dpiLob.cpp
dpiCommon.cpp
win_delay_load_hook.c
C:\Devnodejsnode_modules\npmnode_modulesnode-gyp\src\win_delay_load_hook.c(12): warning C4005: 'WIN32_LEAN_AND_MEAN' : macro redefinition [C:\Dev\Java\P
command-line arguments : see previous definition of 'WIN32_LEAN_AND_MEAN'
Creating library C:\Dev\Java\ProjectBis\ORATESTnode_modules\oracledb\build\Release\oracledb.lib and object C:\Dev\Java\ProjectBis\API_REST_Hu
Generating code
Finished generating code
oracledb.vcxproj -> C:\Dev\Java\ProjectBis\ORATESTnode_modules\oracledb\build\Release\oracledb.node
[email protected] C:\Dev\Java\ProjectBis\ORATEST
+-- [email protected]
+-- [email protected]

C:\Dev\Java\ProjectBis\ORATEST>node app.js
C:\Dev\Java\ProjectBis\ORATESTnode_modules\oracledb\lib\oracledb.js:28
throw err;
^

Error: La proc茅dure sp茅cifi茅e est introuvable.
\?\C:\Dev\Java\ProjectBis\ORATESTnode_modules\oracledb\build\Release\oracledb.node
at Error (native)
at Object.Module._extensions..node (module.js:450:18)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (C:\Dev\Java\ProjectBis\ORATESTnode_modules\oracledb\lib\oracledb.js:23:15)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)

PATH seems OK ->
PATH=C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Devnodejs\;C:\Devnodejs\driver\instantclient_12_1;C:\Devnodejs\driver\instantclient_12_1\sdk\include;C:\Devnodejs\driver\instantclient_12_1\sdk\lib\msvc

Stuck... Thanks for any help
node -v > v5.1.0
oracledb > 1.4.0

@piotrjaw checking again, you seem not to have Instant Client correctly in your PATH. It should contain C:\oracle\instantclient if that is where you unzipped to. The paths you have are used only during installation and never set in PATH.

@cadetjj Hmm. What compiler? Did you try an older Node (I don't think we've checked Node 5.1 on Windows)? Did you try https://github.com/oracle/node-oracledb/issues/18 ?

PS @pvenkatraman told me yesterday the WIN32_LEAN_AND_MEAN issue isn't in node-oracledb code. It can be ignored. I see he logged https://github.com/nodejs/node-gyp/issues/823

Seems to be a problem with path ...

  • downgrade to 4.2 version of node.js
  • checked the filesystem
  • change path _C:\Devnodejs\driver\instantclient_12_1\sdk\include_ to _C:\oracle\instantclient_\sdk\include
  • put the 'C:\oracle\instantclient' at the beginning of the path
    -> Error solved.

Thx !

@cjbj I guess all the other conditions were met, because fixing the PATH did the trick - thanks!

@cadetjj Glad you have it working. Maybe something in C:\ProgramData\Oracle\Java\javapath interfered?

As a general reminder, you don't need to have the sdk directories in PATH.

Thanks . This works for me...

For what it's worth. I had the same issue and found that my Windows PATH variable was pointing at an oracle11g/bin directory that contained a number of oracle DLLs. When I removed this from my PATH and replaced it with the location of my Oracle 12 DLLs It ran fine after I re-installed (node install oracledb).

@witcradg thanks for the comment. A mixed environment is always tricky. It's good to hear the cause and matching error.

Hi,

I am facing this problem in windows 10, the OracleDB install was sucessfull but while exectuing a .js file (which has code to connect DB), getting below error

C:\Users**\IdeaProjects\NodeProject\Copynode_modules\oracledb\lib\oracledb.js:38
throw err;
^

Error: The specified module could not be found.
\?\C:\Users****\IdeaProjects\NodeProject\Copynode_modules\oracledb\build\Release\oracledb.node
at Object.Module._extensions..node (module.js:598:18)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (C:\Users****\IdeaProjects\NodeProject\Copynode_modules\oracledb\lib\oracledb.js:35:19)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)

below paths are set
OCI_INC_DIR=C:\Oracle1\Instantclient\sdk\include
OCI_LIB_DIR=C:\Oracle1\Instantclient\sdk\lib\msvc

Thanks in Advance!

@manick7 Did you find a solution to this problem?
I have the same problem too.

Thanks in Advance..

Hello,
Searching in forums, I confront myself with this:

npm install oracledb --msvs_version=2013

, with this line, indicated to oracledb that must be compiled with Microsoft Visual Studio 2013, which is the version previously installed on my computer. This did not work for me, but you can try.
Then install the GCC compiler by means of minGW and compile the oracledb module with it and I managed to work, it was like this:

npm install oracledb gcc

Description
S.O: Windows 7 Professional 86x
Node.js: v6.10.2
NPM: 3.10.10
InstantClient Oracle: instantclient-sdk-nt-12.2.0.1.0 instantclient-basic-nt-12.2.0.1.0

Greetings and thanks for your comments.

Was this page helpful?
0 / 5 - 0 ratings