Skip to content

Loading…

Error while running node server using Oracle Driver #154

Open
OussamaAouni opened this Issue · 13 comments

5 participants

@OussamaAouni

Please I hope that I didn't bother you by this issue

I succeed to install oracle module with npm !

But I can't run my server and I got this error

C:\Users\Oussama\Desktop\SPI-master>node server.js

module.js:356
Module._extensionsextension;
^
Error: no errorC:\Users\Oussama\Desktop\SPI-master\node_modules\oracle\build\Rel
ease\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. (C:\Users\Oussama\Desktop\SPI-master\node_modules\orac
le\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)

@kontrafiktion

Please try:

node -e "console.log(process.arch, require('os').arch())"

to verify 32Bit/64Bit

Please verify instantclient 32/64 Bit

Please verify node-oracle 32/64 Bit

@OussamaAouni

this is the result of the excution of the command :

C:\Users\Oussama\Desktop\SPI-master>node -e "console.log(process.arch, require('os').arch())"
ia32 ia32

and I'm sure that instantclient is 32 Bits and also node and oracle

@OussamaAouni

I have seen this issue #78
and I think i should do the same thing !
What should I do on Windows ti fix the "symlinks" ? thanx a lot

@raztus
Collaborator

The symlinks are not required on Windows. However, if you are not using version 11.x of the Oracle Instantclient, you will need to set OCI_VERSION=12 in your environment variables.

@OussamaAouni

thank you @raztus but this is what I've done :/
Really I don't know what's the real problem !
All the installed programs are in 32 bits, I followed the read me and the installation guide !!!

@raztus
Collaborator

I believe your issue is the same as #90

@fastpoint

I get this error too:

module.js:356
Module._extensionsextension;
^
Error: The specified procedure could not be found.
E:\blog\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. (E:\blog\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)

I'm no idel,my environment is Win7 32,and oracle client is setup.who help me?

@kontrafiktion

@fastpoint I do not believe that yours is the same error.
This issue is about "Error: no error".
You've got:

Error: The specified procedure could not be found.

In which directory did you invoke

 npm install oracle

It should be same directory where you start node.
And please check #72

If that does not help:
Please create a new issue

@OussamaAouni

I resolved my problem,
In fact it's caused by the oracle instant client basic driver :
It's A problem of loading oracle modules
I used the dependecy Walker to look for the error :
The OCI.DLL file wasn't visible for the ORAICCI12D.DLL
So it ccan't load succefully oracle from node_modules !!!
So what I did is to execute the command :
Set PATH=C:\OracleInstantClient\instant client-basic-nt-12.1.0.1.0\instantclient_12_1;%PATH%
It works and I haven't the error mentionned before until I don't close the cmd...
But if I restart I got the same error !!!
So I have to do that each time.

Now I have another error is that the server stops when I excute and SQL query to get results from my database !!!
I tried to make a cconsolr.log before and after the SQL bloc. Result: I got the two messages ...
The problem comes from connection.execute(the sql query) !!!

@bjouhier

connection.execute is an async function. You have to pass a callback:

connection.execute(sql, function(err, results) {
  if (err) throw err;
  // do something with results
});
// code here will be executed immediately, while execute is still running
@OussamaAouni

that's what I did

oracle.connect(connectData, function(err, connection) {
if (err) { console.log("Error connecting to db:", err); return; }
// Execution d'une requete et affichage du résultat dans les logs
connection.execute("SELECT * FROM ENSEIGNANT", [], function(err, results) {
if (err) { console.log("Error executing query:", err); return; }
//accueil.afficher(results);
console.log(results);
connection.close(); // call only when query is finished executing
});
});

@raztus
Collaborator

@OussamaAouni could you please paste your new error in? It's not entirely clear what issue you're seeing now.

@OussamaAouni

there's no error ! the server stops running on localhost:9090 without showing any data from the database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.