@@ -36,12 +36,11 @@ limitations under the License.
36
36
- 3.5 [ Node-oracledb Installation on AIX on Power Systems with Instant Client ZIP files] ( #instaix )
37
37
- 3.6 [ Node-oracledb Installation on Oracle Solaris x86-64 (64-Bit) with Instant Client ZIP files] ( #instsolarisx8664 )
38
38
- 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 )
45
44
- 3.8 [ Node-oracledb Installation Without Internet Access] ( #offline )
46
45
- 3.8.1 [ Copying node-oracledb Binaries on Windows] ( #winbins )
47
46
- 3.9 [ Hosting your own node-oracledb Packages] ( #selfhost )
@@ -90,29 +89,21 @@ Alternatively, follow these instructions:
90
89
91
90
- Install Node.js from [ nodejs.org] [ 11 ] .
92
91
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).
96
96
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/` .
98
99
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 ] .
101
101
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` .
116
107
117
108
- Add Oracle Client libraries version 21, 19, 18, 12, or 11.2 to your operating
118
109
system library search path such as ` PATH ` on Windows or ` LD_LIBRARY_PATH ` on
@@ -146,12 +137,12 @@ Alternatively, follow these instructions:
146
137
You will need to know [ database credentials] [ 45 ] and the [ connection
147
138
string] [ 7 ] for the database.
148
139
149
- After installation, learn how to use node-oracledb from the
150
- [ examples] [ 19 ] and the [ documentation] [ 44 ] .
151
-
152
140
See [ Troubleshooting Node-oracledb Installation
153
141
Problems] ( #troubleshooting ) if you have installation issues.
154
142
143
+ After installation, learn how to use node-oracledb from the
144
+ [ examples] [ 19 ] and the [ documentation] [ 44 ] .
145
+
155
146
## <a name =" instructions " ></a > 3. Node-oracledb Installation Instructions
156
147
157
148
Instructions may need to be adjusted for your platform, environment and versions being used.
@@ -207,22 +198,9 @@ All installations need:
207
198
You will need to know [ database credentials] [ 45 ] and the [ connection
208
199
string] [ 7 ] for the database.
209
200
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 ) .
226
204
227
205
#### <a name =" linuxinstall " ></a > 3.2 Node-oracledb Installation on Linux
228
206
@@ -1340,16 +1318,12 @@ Run one of the examples, such as [`example.js`][63]:
1340
1318
node example.js
1341
1319
```
1342
1320
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
1348
1322
1349
1323
Some build tools are required to compile node-oracledb.
1350
1324
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 .
1353
1327
1354
1328
- If another version of Python occurs first in your binary path then
1355
1329
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).
1361
1335
1362
1336
Install a C compiler:
1363
1337
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.
1365
1339
1366
1340
- On macOS (Intel x86) install Xcode from the Mac App store.
1367
1341
@@ -1379,7 +1353,7 @@ vcvars.bat if you building with 32-bit binaries) to set the
1379
1353
environment. Alternatively you can open the 'Developer Command Prompt
1380
1354
for Visual Studio' which has environment variables already configured.
1381
1355
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
1383
1357
1384
1358
If you clone the node-oracledb repository, or download a zip from [ GitHub] [ 1 ] to
1385
1359
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**.
1398
1372
git submodule update
1399
1373
```
1400
1374
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:
1404
1377
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
+ ```
1406
1383
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:
1409
1385
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:
1413
1397
1414
1398
```
1415
1399
"dependencies": {
@@ -1423,30 +1407,27 @@ Alternatively, use the command:
1423
1407
npm install oracle/node-oracledb#main
1424
1408
```
1425
1409
1426
- To install from a tag, use the tag name like:
1410
+ To install from a tag, replace ` main ` with the tag name like:
1427
1411
` oracle/node-oracledb#v5.2.0 ` .
1428
1412
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
1434
1414
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:
1436
1417
1437
1418
```
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
+ },
1439
1422
```
1440
1423
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:
1444
1425
1445
1426
```
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
1447
1428
```
1448
1429
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
1450
1431
1451
1432
Oracle has a mirror of the GitHub repository source code that can be cloned
1452
1433
with:
@@ -1458,10 +1439,22 @@ git submodule init
1458
1439
git submodule update
1459
1440
```
1460
1441
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:
1463
1444
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
1465
1458
1466
1459
You can create a package containing the binary module and required JavaScript
1467
1460
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
1564
1557
Alternatively, if you want to build your own binaries and node-oracledb package,
1565
1558
see [ Creating a node-oracledb package from source code] ( #compilepackage ) .
1566
1559
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:
1576
1562
1577
1563
```
1578
1564
. . .
@@ -1582,6 +1568,12 @@ or your `package.json` would contain:
1582
1568
. . .
1583
1569
```
1584
1570
1571
+ Or you would install with:
1572
+
1573
+ ```
1574
+ npm install https://www.example.com/oracledb-5.2.0.tgz
1575
+ ```
1576
+
1585
1577
### <a name =" docker " ></a > 3.10 Using node-oracledb in Docker
1586
1578
1587
1579
[ 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`
1728
1720
"start": "node server.js"
1729
1721
},
1730
1722
"dependencies": {
1731
- "oracledb" : "^4 "
1723
+ "oracledb" : "^5 "
1732
1724
},
1733
1725
. . .
1734
1726
```
@@ -1803,6 +1795,9 @@ RUN npm install
1803
1795
CMD exec node server.js
1804
1796
```
1805
1797
1798
+ Note: you should review Oracle's supported distributions before choosing an
1799
+ operating system.
1800
+
1806
1801
For either Dockerfile, the ` package.json ` is:
1807
1802
1808
1803
```
0 commit comments