oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

Node Module Did not self-register on Window | node-oracledb Prebuilt Binary issue #1530

Closed darshithedpara closed 1 year ago

darshithedpara commented 1 year ago

1. What versions are you using?

process.platform : win32
process.version: v14.20.1
process.arch: x64
require('oracledb').versionString: Not able to get due to above error
require('oracledb').oracleClientVersionString: Not able to get due to above error

2. Describe the problem.

npm i oracledb image

It is giving error when tried to getConnection of remote oracledb:

node oracle.mjs : below is the content of my source code. image

Error I am getting : image


3. Are you installing into vanilla Node.js, or using something like Electron? Vanilla Nodejs v14.20.1


4. Show the directory listing where your Oracle Client libraries are installed (e.g. the Instant Client directory). Is it 64-bit or 32-bit?

Location : C:\Oracle\Client\19.3.0_64 "It is 64-bit"


  1. Show what the PATH environment variable (on Windows) or LD_LIBRARY_PATH (on Linux) are set to? NOT SET

  1. Show any Oracle environment variables set (e.g. ORACLE_HOME, ORACLE_BASE). ORACLE_HOME=C:\Oracle\Client\19.3.0_64

cjbj commented 1 year ago

Please don't use screenshots since not everyone can read them, and we can't cut & paste from them.

darshithedpara commented 1 year ago

Please don't use screenshots since not everyone can read them, and we can't cut & paste from them.

I am using Remote machine and I am not able to copy the source codes @cjbj

pvenkatraman commented 1 year ago
  1. Instant client directory should be in the PATH environment variable.
  2. Your second screen shots shows that it is not able to load oracledb.node. NODE_PATH environment variable is required and should point to lib/ directory where oracledb.js is available.
darshithedpara commented 1 year ago

Hi @pvenkatraman , There is not lib folder in my installation, Can you please explain in detail ? image

pvenkatraman commented 1 year ago
  1. npm install oracledb -> this creates node_modules\ directory and pulls in different modules including oracledb\ Look in node_modules\oracledb\lib\ directory contains oracledb.js and add this directory to NODE_PATH environment variable.
  2. Add C:\Oracle\Client\19.3.0_64\bin directory to PATH environment variable and try again.
darshithedpara commented 1 year ago

1] C:\Oracle\Client\19.3.0_64\bin and C:\Oracle\Client\19.3.0_64 is already exist in system env PATH 2] I have added NODE_PATH as you instructed

still getting same error @pvenkatraman

pvenkatraman commented 1 year ago

In your cmd window - do echo %PATH% and echo %NODE_PATH% and check whether these directories are included.

darshithedpara commented 1 year ago

Yes It's there @pvenkatraman image

pvenkatraman commented 1 year ago

NODE_PATH should not include oracledb.js. only the directory.

darshithedpara commented 1 year ago

Yes I've tried that , still I am getting same error of module did not self register @pvenkatraman image

darshithedpara commented 1 year ago

I want to know what causing the issue, It is issue with node or node-oracledb binary ? or may be PATH env issue ?

Can you please help ? @pvenkatraman @cjbj

cjbj commented 1 year ago

Checked Google? I can see a few hits with various suggestions for debugging. I still can't read screen shots properly but I see you have Instant Client and some full client installed. Maybe you have a clash?

darshithedpara commented 1 year ago

Yes you're right I have downloaded instantClient folder manually and I have updated PATH variable but that also not worked so I am not using that instantClient anymore also removed all reference from PATH variable. @cjbj

sharadraju commented 1 year ago

@darshithedpara Are you still facing this issue?

darshithedpara commented 1 year ago

Yes @sharadraju

sharadraju commented 1 year ago

@darshithedpara Have you tried installing other npm modules? Do they give the same error? You can try rebuilding npm in your machine as shown here.

Also, node-oracledb apps using Instant Client for Windows users will require the Visual Studio 2017 Redistributable as shown here. Please let us know if it is installed.

darshithedpara commented 1 year ago

npm rebuild - I’ve tried no luck. and In my machine I have these redistribution libs image

Please advise should I need to install 2017 even if 2015-2022 is installed ? @sharadraju

stale[bot] commented 1 year ago

This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically closed because it has not been updated for a month.