|
1 | 1 | # Overview |
2 | 2 |
|
3 | 3 | This directory is used for building the [node-oracledb npm |
4 | | -package](https://www.npmjs.com/package/oracledb). The scripts can |
5 | | -also be used to create custom packages for hosting on a local server. |
| 4 | +package](https://www.npmjs.com/package/oracledb). The scripts can also be used |
| 5 | +to create a custom package for hosting on a local server. |
6 | 6 |
|
7 | 7 | Most users do not need to use anything in this directory. |
8 | 8 |
|
9 | 9 | # Maintainers |
10 | 10 |
|
11 | 11 | In a clone or copy of the repository: |
12 | 12 |
|
13 | | -- `npm run buildbinary` calls `buildbinary.js` to create a |
14 | | - node-oracledb binary for the current operating system. |
| 13 | +- Run `npm run buildbinary`. This calls `buildbinary.js` to create a |
| 14 | + node-oracledb binary for the current operating system. Depending how Node.js |
| 15 | + was installed, you may need to run `npm install node-gyp -g` first. |
15 | 16 |
|
16 | | -- `npm run buildpackage` calls `buildpackage.js` to make the |
17 | | - node-oracledb package containing the node-oracledb JavaScript files, |
18 | | - the available binaries, and a package.json that has an `install` |
19 | | - script and a `prune` script. The package will be created in the top |
20 | | - level directory. |
| 17 | + You can run `npm run buildbinary` on each operating system architecture that |
| 18 | + you want to include in your package. Copy the node-oracledb binaries and |
| 19 | + related build metadata information files to the `package/Staging` directory on |
| 20 | + one machine. |
21 | 21 |
|
22 | | - Before executing `npm run buildpackage`, all node-oracledb binaries |
23 | | - and related build metadata information files from all operating |
24 | | - systems should be placed in the `package/Staging` directory. |
| 22 | +- Run `npm run buildpackage`. This calls `buildpackage.js` to make the |
| 23 | + node-oracledb package containing the node-oracledb JavaScript files, the |
| 24 | + available binaries, and a `package.json` that has `install` and `prune` script |
| 25 | + targets. The package will be created in the top level directory. It can be |
| 26 | + uploaded to npmjs.com, or to your own local server, and then used as a |
| 27 | + dependency in your projects. |
25 | 28 |
|
26 | 29 | # Package Installation |
27 | 30 |
|
28 | | -- As part of an `npm install` that uses the created package, the |
29 | | - `package.json` install script runs `install.js` to check a binary |
30 | | - module for the current Node.js and operating system is available. |
31 | | - |
32 | | - If a suitable binary is not available, installation will fail. |
33 | | - Users must then compile node-oracledb using source code from GitHub. |
34 | | - Alternatively a different version of node-oracledb, Node.js, or |
35 | | - different operating system may have a suitable pre-built binary |
36 | | - available. |
37 | | - |
38 | | -- After install, space conscious users can run `npm run prune` which |
39 | | - removes pre-built binaries for all other operating systems. |
40 | | - |
41 | | -By default the top level `package.json` doesn't have an `install` |
42 | | -script target. This means that node-gyp will be invoked to compile |
43 | | -node-oracledb. This allows installation from [source |
44 | | -code](https://oracle.github.io/node-oracledb/INSTALL.html#github) (via |
45 | | -GitHub) when no suitable pre-built binary is available. |
| 31 | +- As part of an `npm install` that uses the created package, the `package.json` |
| 32 | + install script runs `install.js` to check the availability of a binary module |
| 33 | + for the current Node.js version and operating system architecture. |
| 34 | + |
| 35 | + If a suitable binary is not available, installation will fail. Users must |
| 36 | + then compile node-oracledb using source code from GitHub. Alternatively a |
| 37 | + different version of node-oracledb, Node.js, or different operating system may |
| 38 | + have a suitable pre-built binary available. See |
| 39 | + https://github.com/oracle/node-oracledb/releases for information about Node.js |
| 40 | + versions and pre-built node-oracledb binaries. |
| 41 | + |
| 42 | +- After install, space conscious users can run `npm run prune` which removes |
| 43 | + pre-built binaries for all other architectures. |
| 44 | + |
| 45 | +The |
| 46 | +[`package.json`](https://github.com/oracle/node-oracledb/blob/master/package.json) |
| 47 | +in GitHub doesn't have an `install` script target by default. This means that |
| 48 | +node-gyp will be invoked to compile node-oracledb. This allows installation |
| 49 | +from GitHub [source |
| 50 | +code](https://oracle.github.io/node-oracledb/INSTALL.html#github) when no |
| 51 | +suitable pre-built binary is available. |
0 commit comments