Skip to content

Commit 63f2512

Browse files
committed
Update compilation instructions
1 parent 8885841 commit 63f2512

File tree

1 file changed

+84
-89
lines changed

1 file changed

+84
-89
lines changed

INSTALL.md

Lines changed: 84 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ limitations under the License.
3636
- 3.5 [Node-oracledb Installation on AIX on Power Systems with Instant Client ZIP files](#instaix)
3737
- 3.6 [Node-oracledb Installation on Oracle Solaris x86-64 (64-Bit) with Instant Client ZIP files](#instsolarisx8664)
3838
- 3.7 [Node-oracledb Installation from Source Code](#github)
39-
- 3.7.1 [Environment for compiling from source code](#compileenv)
40-
- 3.7.2 [Installing GitHub clones and ZIP files](#githubclone)
41-
- 3.7.3 [Installing using GitHub branches and tags](#githubtags)
42-
- 3.7.4 [Installing from a source package](#sourcepackage)
43-
- 3.7.5 [Installing from Oracle's repository](#nogithubaccess)
44-
- 3.7.6 [Creating a node-oracledb package from source code](#compilepackage)
39+
- 3.7.1 [Installing GitHub clones and ZIP files](#githubclone)
40+
- 3.7.2 [Installing using GitHub branches and tags](#githubtags)
41+
- 3.7.3 [Installing from a source package](#sourcepackage)
42+
- 3.7.4 [Installing from Oracle's repository](#nogithubaccess)
43+
- 3.7.5 [Creating a node-oracledb package from source code](#compilepackage)
4544
- 3.8 [Node-oracledb Installation Without Internet Access](#offline)
4645
- 3.8.1 [Copying node-oracledb Binaries on Windows](#winbins)
4746
- 3.9 [Hosting your own node-oracledb Packages](#selfhost)
@@ -90,29 +89,21 @@ Alternatively, follow these instructions:
9089

9190
- Install Node.js from [nodejs.org][11].
9291

93-
- Install node-oracledb using the `npm` package manager, which is included in
94-
Node.js. If you are behind a firewall, you may need to set the proxy with
95-
`npm config set proxy http://myproxy.example.com:80/`.
92+
- Add `oracledb` to your `package.json` dependencies or run `npm install
93+
oracledb`. This installs from the [npm registry][4]. Pre-built
94+
node-oracledb binaries are available for Windows 64-bit, Linux x86_64, and
95+
macOS (Intel x86).
9696

97-
- Many users will be able to use a pre-built node-oracledb binary:
97+
If you are behind a firewall, you may need to set the proxy with `npm config
98+
set proxy http://myproxy.example.com:80/`.
9899

99-
- Add `oracledb` to your `package.json` dependencies or run `npm install
100-
oracledb`. This installs from the [npm registry][4].
100+
Windows users will require the [Visual Studio 2017 Redistributable][27].
101101

102-
Windows users will require the [Visual Studio 2017
103-
Redistributable][27].
104-
105-
- If a binary is not available, you will need to compile node-oracledb
106-
from source code:
107-
108-
- Install [Python 2.7][2] (Note: recent Node.js tools should work with Python 3).
109-
110-
- Install a C Compiler such as Xcode, GCC, Visual Studio
111-
2017, or similar.
112-
113-
- Run `npm install oracle/node-oracledb.git#v5.2.0`, or add
114-
`oracle/node-oracledb.git#v5.2.0` to your `package.json`
115-
dependencies. Substitute your desired [GitHub tag][40].
102+
- If a pre-built binary is not available, you will need to build from source
103+
code. Reivew the [prerequisites](#github) and add
104+
`https://github.com/oracle/node-oracledb/releases/download/v5.2.0/oracledb-src-5.2.0.tgz`
105+
to your `package.json` dependencies or run `npm install
106+
https://github.com/oracle/node-oracledb/releases/download/v5.2.0/oracledb-src-5.2.0.tgz`.
116107

117108
- Add Oracle Client libraries version 21, 19, 18, 12, or 11.2 to your operating
118109
system library search path such as `PATH` on Windows or `LD_LIBRARY_PATH` on
@@ -146,12 +137,12 @@ Alternatively, follow these instructions:
146137
You will need to know [database credentials][45] and the [connection
147138
string][7] for the database.
148139

149-
After installation, learn how to use node-oracledb from the
150-
[examples][19] and the [documentation][44].
151-
152140
See [Troubleshooting Node-oracledb Installation
153141
Problems](#troubleshooting) if you have installation issues.
154142

143+
After installation, learn how to use node-oracledb from the
144+
[examples][19] and the [documentation][44].
145+
155146
## <a name="instructions"></a> 3. Node-oracledb Installation Instructions
156147

157148
Instructions may need to be adjusted for your platform, environment and versions being used.
@@ -207,22 +198,9 @@ All installations need:
207198
You will need to know [database credentials][45] and the [connection
208199
string][7] for the database.
209200

210-
If pre-built binaries are not available or desired, you need these
211-
additional tools to build from source code:
212-
213-
- A compiler.
214-
215-
Use Visual Studio on Windows, GCC on Linux or Xcode on macOS.
216-
217-
- [Python 2.7][2] is needed by node-gyp, which is invoked by npm. Run `python
218-
--version` to find the version you have. (Note: recent Node.js tools should
219-
work with Python 3).
220-
221-
If another version of Python occurs first in your binary path then,
222-
when you install node-oracledb, then run `npm config set python
223-
/wherever/python-2.7/bin/python` or use the `--python` option to
224-
indicate the correct version. For example: `npm install
225-
--python=/wherever/python-2.7/bin/python oracledb`.
201+
Pre-built node-oracledb binaries are available for Windows 64-bit, Linux
202+
x86_64, and macOS (Intel x86). For other platforms you need to [build from
203+
source code](#github).
226204

227205
#### <a name="linuxinstall"></a> 3.2 Node-oracledb Installation on Linux
228206

@@ -1340,16 +1318,12 @@ Run one of the examples, such as [`example.js`][63]:
13401318
node example.js
13411319
```
13421320

1343-
### <a name="github"></a> 3.7 Node-oracledb Installation from Source Code
1344-
1345-
Node-oracledb can be compiled from the source code.
1346-
1347-
#### <a name="compileenv"></a> 3.7.1 Environment for compiling from source code
1321+
### <a name="github"></a> <a name="compileenv"></a> 3.7 Node-oracledb Installation from Source Code
13481322

13491323
Some build tools are required to compile node-oracledb.
13501324

1351-
Install [Python 2.7][2], which is required for the node-gyp utility. (Note:
1352-
recent Node.js tools should work with Python 3).
1325+
Recent Node.js tools should work with Python 3 but you may need to install
1326+
[Python 2.7][2] for the node-gyp utility.
13531327

13541328
- If another version of Python occurs first in your binary path then
13551329
run `npm config set python /wherever/python-2.7/bin/python` or use
@@ -1361,7 +1335,7 @@ recent Node.js tools should work with Python 3).
13611335

13621336
Install a C compiler:
13631337

1364-
- On Linux, GCC 4.4.7 (the default on Oracle Linux 6) is known to work.
1338+
- On Linux, GCC 4.8.5 (the default on Oracle Linux 7) is known to work.
13651339

13661340
- On macOS (Intel x86) install Xcode from the Mac App store.
13671341

@@ -1379,7 +1353,7 @@ vcvars.bat if you building with 32-bit binaries) to set the
13791353
environment. Alternatively you can open the 'Developer Command Prompt
13801354
for Visual Studio' which has environment variables already configured.
13811355

1382-
#### <a name="githubclone"></a> 3.7.2 Installing GitHub clones and ZIP files
1356+
#### <a name="githubclone"></a> 3.7.1 Installing GitHub clones and ZIP files
13831357

13841358
If you clone the node-oracledb repository, or download a zip from [GitHub][1] to
13851359
build node-oracledb from source code, then you need to make sure the [ODPI-C
@@ -1398,18 +1372,28 @@ like **'dpi.h' file not found**.
13981372
git submodule update
13991373
```
14001374

1401-
To install, change to your application directory, and then run `npm install
1402-
your_dir_path/node-oracledb`. Or add `file:/your_dir_path/node-oracledb` to
1403-
your `package.json` dependencies.
1375+
With the node-oracledb source code in `your_dir_path/node-oracledb` use a
1376+
`package.json` dependency like:
14041377

1405-
#### <a name="githubtags"></a> 3.7.3 Installing using GitHub branches and tags
1378+
```
1379+
"dependencies": {
1380+
"oracledb": "file:/your_dir_path/node-oracledb"
1381+
},
1382+
```
14061383

1407-
Node-oracledb can be installed from GitHub tags and branches. The `git` source
1408-
code utility is required for this method.
1384+
Alternatively change to your application directory and run:
14091385

1410-
Build node-oracledb from source code by changing the package specifier so that
1411-
`npm` downloads from GitHub. For example, to install the current development
1412-
code from the GitHub main branch, use a `package.json` dependency like:
1386+
```
1387+
npm install your_dir_path/node-oracledb
1388+
```
1389+
1390+
#### <a name="githubtags"></a> 3.7.2 Installing using GitHub branches and tags
1391+
1392+
Node-oracledb can be installed directly from GitHub tags and branches. The
1393+
`git` source code utility is required for this method.
1394+
1395+
To install the current development code from the GitHub main branch, use a
1396+
`package.json` dependency like:
14131397

14141398
```
14151399
"dependencies": {
@@ -1423,30 +1407,27 @@ Alternatively, use the command:
14231407
npm install oracle/node-oracledb#main
14241408
```
14251409

1426-
To install from a tag, use the tag name like:
1410+
To install from a tag, replace `main` with the tag name like:
14271411
`oracle/node-oracledb#v5.2.0`.
14281412

1429-
These commands will download, compile and install node-oracledb. Due to the
1430-
slow download of source code from GitHub, it may take some time before
1431-
compilation begins.
1432-
1433-
#### <a name="sourcepackage"></a> 3.7.4 Installing from a source package
1413+
#### <a name="sourcepackage"></a> 3.7.3 Installing from a source package
14341414

1435-
Users without the `git` utility can compile pre-bundled source code:
1415+
Users without `git` can compile pre-bundled source code using a `package.json`
1416+
dependency like:
14361417

14371418
```
1438-
npm install https://github.com/oracle/node-oracledb/releases/download/v5.2.0/oracledb-src-5.2.0.tgz
1419+
"dependencies": {
1420+
"oracledb": "https://github.com/oracle/node-oracledb/releases/download/v5.2.0/oracledb-src-5.2.0.tgz"
1421+
},
14391422
```
14401423

1441-
Due to the slow download of source code from GitHub, it may take some time
1442-
before compilation begins. You may prefer to download
1443-
`oracledb-src-5.2.0.tgz` and install with:
1424+
Or install with:
14441425

14451426
```
1446-
npm install your_dir_path/oracledb-src-5.2.0.tgz
1427+
npm install https://github.com/oracle/node-oracledb/releases/download/v5.2.0/oracledb-src-5.2.0.tgz
14471428
```
14481429

1449-
#### <a name="nogithubaccess"></a> 3.7.5 Installing from Oracle's repository
1430+
#### <a name="nogithubaccess"></a> 3.7.4 Installing from Oracle's repository
14501431

14511432
Oracle has a mirror of the GitHub repository source code that can be cloned
14521433
with:
@@ -1458,10 +1439,22 @@ git submodule init
14581439
git submodule update
14591440
```
14601441

1461-
To install, first change to a directory outside the clone directory, and then
1462-
run `npm install your_dir_path/your-clone-directory`.
1442+
With the node-oracledb source code in `your_dir_path/node-oracledb` use a
1443+
`package.json` dependency like:
14631444

1464-
#### <a name="compilepackage"></a> 3.7.6 Creating a node-oracledb package from source code
1445+
```
1446+
"dependencies": {
1447+
"oracledb": "file:/your_dir_path/node-oracledb"
1448+
},
1449+
```
1450+
1451+
Alternatively change to your application directory and run:
1452+
1453+
```
1454+
npm install your_dir_path/node-oracledb
1455+
```
1456+
1457+
#### <a name="compilepackage"></a> 3.7.5 Creating a node-oracledb package from source code
14651458

14661459
You can create a package containing the binary module and required JavaScript
14671460
files. This is equivalent to the package that is normally installed from the
@@ -1564,15 +1557,8 @@ Download the node-oracledb package from npm, for example from
15641557
Alternatively, if you want to build your own binaries and node-oracledb package,
15651558
see [Creating a node-oracledb package from source code](#compilepackage).
15661559

1567-
If you make the package accessible on your local web server, for
1568-
example at www.example.com/oracledb-5.2.0.tgz, then your
1569-
install command would be:
1570-
1571-
```
1572-
npm install https://www.example.com/oracledb-5.2.0.tgz
1573-
```
1574-
1575-
or your `package.json` would contain:
1560+
If you make the package accessible on your local web server, for example at
1561+
www.example.com/oracledb-5.2.0.tgz, then your `package.json` would contain:
15761562

15771563
```
15781564
. . .
@@ -1582,6 +1568,12 @@ or your `package.json` would contain:
15821568
. . .
15831569
```
15841570

1571+
Or you would install with:
1572+
1573+
```
1574+
npm install https://www.example.com/oracledb-5.2.0.tgz
1575+
```
1576+
15851577
### <a name="docker"></a> 3.10 Using node-oracledb in Docker
15861578

15871579
[Docker][59] allows applications to be containerized. Each application will
@@ -1728,7 +1720,7 @@ Include node-oracledb as a normal dependency in your application `package.json`
17281720
"start": "node server.js"
17291721
},
17301722
"dependencies": {
1731-
"oracledb" : "^4"
1723+
"oracledb" : "^5"
17321724
},
17331725
. . .
17341726
```
@@ -1803,6 +1795,9 @@ RUN npm install
18031795
CMD exec node server.js
18041796
```
18051797

1798+
Note: you should review Oracle's supported distributions before choosing an
1799+
operating system.
1800+
18061801
For either Dockerfile, the `package.json` is:
18071802

18081803
```

0 commit comments

Comments
 (0)