A recent project needs to use Nodejs to connect to the Oracle database, on the internet for a long time, in accordance with the practice on the Internet has been unable to succeed, the error message is NODE-GYP rebuild related, and finally through continuous testing, found that manual compilation can be successful.
First you need to install node-oracle required dependencies, including python2.7 (choose to add them to the environment variable), Oracle's Instantclient_12_1 Basic and Sdk,vs2012,nodejs, Because I even have a remote Oracle, I don't have Oracle installed.
After installation, you need to set the system variable oci_include_dir,oci_lib_dir,oci_version. There are many online, not to repeat it here.
Then install Node-gyp
NPM Install Node-gyp-g
Finally to https://github.com/joeferner/node-oracle#basic-installation download node-oracle source code, manually compiled
NPM Install Source Directory
then wait patiently.
A lot of yellow warnings were found after the compilation, but there was no problem with it.
It is also possible to copy the compiled Node-oracle module to another project directory.
Win7 node. JS connection to the Oracle database