P Kwong
P Kwong

Reputation: 21

Unable to install [email protected]

I have a nodejs project and when I run npm i I run into the following error:

oracledb ERR! NJS-067: a pre-built node-oracledb binary was not found for Node.js v12.13.0 (NODE_MODULE_VERSION=72) on darwin x64
oracledb ERR! Try compiling node-oracledb source code using https://oracle.github.io/node-oracledb/INSTALL.html#github

I have tried updating the package.json to include "oracledb": "github:oracle/node-oracledb#v4.0.1" but it continues to show [email protected] install. I tried running npm uninstall oracledb as well but also caused the same error.

NodeJs v: 12.13.0 Python: 2.7.10

Upvotes: 1

Views: 3859

Answers (3)

Paul Wang
Paul Wang

Reputation: 11

Try to use ES module, change the file .js to .mjs, and using require instead of import. It works for me, I think node-oracledb is ESM now.

Upvotes: 1

P Kwong
P Kwong

Reputation: 21

In the end i downgraded NodeJs to version 8.x.x (or less than 12.x.x) as there is no pre-built node-oracledb binary for Node.js v12.13.0. Then I ran npm i again and it worked.

Upvotes: 0

Christopher Jones
Christopher Jones

Reputation: 10536

Hunt around for any node_modules/oracledb directory and remove it manually. Node.js may look up and down the directory tree.

Upvotes: 0

Related Questions