getting module not found exceptions #90

Open
vishalshivnath opened this Issue Oct 23, 2013 · 10 comments

Comments

Projects
None yet
8 participants

Trying to connect to oracle db

var oracle = require('oracle');
var connectData = { "hostname": "UX572.fairisaac.com",
                    "user": "PHMSCHEMA_UI",
                    "password": "autumn",
                    "database": "ifmq1.world"};

oracle.connect(connectData, function(err, connection) {

    // selecting rows
    connection.execute("SELECT * FROM SUSPECT_FLAG", [], function(err, results) {
        if ( err ) {
            console.log(err);
        } else {
            console.log(results);
        }

        connection.close(); // call this when you are done with the connection
});
});

I am getting following error

"C:\Program Files\nodejs\node.exe" databaseconnection.js

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: The specified module could not be found.
C:\Users\vishaltyagi\node_modules\oracle\build\Release\oracle_bindings.node
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\vishaltyagi\node_modules\oracle\lib\oracle.js:2:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Process finished with exit code 8

I have installed oracle module on windows 7

I used the Dependency Walker to find which DLLs were missing on my machine.

Turned out I was missing the Visual C++ Redistributable for Visual Studio 2012.

I believe this is the issue I'm having, except installing Visual C++ Redistributable for Visual Studio 2012 did not solve the problem.

Error: The specified module could not be found.
C:\storm\node\node_modules\oracle\build\Release\oracle_bindings.node
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\storm\node\node_modules\oracle\lib\oracle.js:2:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
Contributor

kontrafiktion commented Feb 15, 2014

please paste the output of npm install oracle and then the directory contents of

<current directory>\node_modules\oracle\build\Release

the directory should be the same where your Javascript code is found

The output of npm install oracle looks like this:

C:\storm\node>npm install oracle
npm WARN package.json storm-twister-server@0.1.0 No description
npm WARN package.json storm-twister-server@0.1.0 No repository field.
npm WARN package.json storm-twister-server@0.1.0 No README data
npm WARN package.json mljs@1.2.0 No repository field.
npm http GET https://registry.npmjs.org/oracle
npm http 304 https://registry.npmjs.org/oracle

> oracle@0.3.6 install C:\storm\node\node_modules\oracle
> node-gyp rebuild


C:\storm\node\node_modules\oracle>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  reader.cpp
  executeBaton.cpp
  outParam.cpp
  connection.cpp
  oracle_bindings.cpp
  statement.cpp
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (..\src\outParam.cpp) [C:\storm\node\node_modul
es\oracle\build\oracle_bindings.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (..\src\executeBaton.cpp) [C:\storm\node\node_m
odules\oracle\build\oracle_bindings.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (..\src\reader.cpp) [C:\storm\node\node_modules
\oracle\build\oracle_bindings.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (..\src\oracle_bindings.cpp) [C:\storm\node\nod
e_modules\oracle\build\oracle_bindings.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (..\src\connection.cpp) [C:\storm\node\node_mod
ules\oracle\build\oracle_bindings.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xlocale(336): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (..\src\statement.cpp) [C:\storm\node\node_modu
les\oracle\build\oracle_bindings.vcxproj]
..\src\outParam.cpp(30): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\reader.cpp(57): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\oracle_bindings.cpp(103): warning C4244: '=' : conversion from 'double' to 'uint32_t', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(182): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(192): warning C4101: 'ex' : unreferenced local variable [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\outParam.cpp(37): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\outParam.cpp(44): warning C4244: '=' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\outParam.cpp(52): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\outParam.cpp(52): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\oracle_bindings.cpp(168): warning C4244: '=' : conversion from 'double' to 'uint32_t', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\executeBaton.cpp(91): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\executeBaton.cpp(92): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\executeBaton.cpp(93): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\executeBaton.cpp(94): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\executeBaton.cpp(95): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\executeBaton.cpp(96): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\executeBaton.cpp(97): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(588): warning C4244: '=' : conversion from 'double' to 'unsigned int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(665): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(670): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(717): warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(799): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
..\src\connection.cpp(804): warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data [C:\storm\node\node_modules\oracle\build\oracle_bindings.vcxproj]
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::Object
          ] (..\src\outParam.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ] (..\src\outParam.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::Object
          ] (..\src\statement.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ] (..\src\statement.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::Object
          ] (..\src\reader.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::Object
          ] (..\src\oracle_bindings.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ] (..\src\reader.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ] (..\src\oracle_bindings.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::Object
          ] (..\src\executeBaton.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::Object
          ] (..\src\connection.cpp)
C:\Users\ReedTH\.node-gyp\0.10.22\deps\v8\include\v8.h(184): warning C4506: no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8::Handle<T>)' [C:\storm\node\node_modules\oracle\build\oracle_bin
dings.vcxproj]
          with
          [
              T=v8::FunctionTemplate
          ] (..\src\connection.cpp)
     Creating library C:\storm\node\node_modules\oracle\build\Release\oracle_bindings.lib and object C:\storm\node\node_modules\oracle\build\Release\oracle_bindings.exp
  Generating code
  Finished generating code
  oracle_bindings.vcxproj -> C:\storm\node\node_modules\oracle\build\Release\\oracle_bindings.node
oracle@0.3.6 node_modules\oracle

C:\storm\node>

And the <current directory>\node_modules\oracle\build\Release directory looks like this:

C:\storm\node\node_modules\oracle\build\Release>dir
 Volume in drive C has no label.
 Volume Serial Number is DA68-1B0D

 Directory of C:\storm\node\node_modules\oracle\build\Release

02/19/2014  06:27 PM    <DIR>          .
02/19/2014  06:27 PM    <DIR>          ..
02/19/2014  06:27 PM    <DIR>          obj
02/19/2014  06:27 PM            25,877 oracle_bindings.exp
02/19/2014  06:27 PM            43,600 oracle_bindings.lib
02/19/2014  06:27 PM            80,384 oracle_bindings.node
02/19/2014  06:27 PM         1,068,032 oracle_bindings.pdb
               4 File(s)      1,217,893 bytes
               3 Dir(s)  895,093,972,992 bytes free

C:\storm\node\node_modules\oracle\build\Release>
@ghost

ghost commented Feb 21, 2014

trevorhreed,

I was encountering this issue as well, like the above post mentioned, use dependency walker on node_modules\oracle\build\Release\oracle_bindings.node to check for missing dlls.

Running Win Server 2012 with VS 2012

I built via: npm install oracle --msvs_version=2012 --oci_version=12

To resolve missing DLLs I had to:

  • add Internet Explorer location to path for ieshims.dll
  • install Media Foundation for mfplat.dll
  • install the Wireless LAN Service for wlanapi.dll

Good luck!

I also get same error with @vishalshivnath,
I see all issue about this error but also don't solve it...
plz help me..

Final, i found out the way resolved my problems (On windows7 32bit, node v0.10.26).
When start app, if the above error still occur,maybe it can not get enviroment variables, try copying all files in instant_client folder to Windows/system32.

Good luck!

bakerw4 commented Aug 18, 2014

This is an environmental variable problem. Make sure c:\instantclient_12_1\vc11; & c:\instantclient_12_1; come before C:\oracle\product\11.2.0\client_1\bin; in your path variables

@salipro4ever yes it worked for me windows 7, 64 bit. Thx. But still facing issue with 'Unknown Error' in executing query.

lent commented Oct 14, 2014

@nareshsaw5: I had similiar problems.
Installing all MSVC++ redistributables also solved my "module not found" issues.
My 'unknown error' originated from Connection::ExecuteStatement / CreateColumnsFromResultSet. It seems that metadata had problems being freed at the end of the function

vector<oracle::occi::MetaData> metadata = rs->getColumnListMetaData();

Other people also report issues with getColumnListMetaData (here, here), especially when mixing compiler versions. I.e. if you use MSVC2010 then OCI_LIB_DIR and Path points to ...vc10. Solved it for me.
Maybe that is also related to #106, #212?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment