The db-oracle could be install off-line?
Because the company cannot connect internet, the db-oracle how to install off-line
You can run npm install db-oracle.tar.gz once you have a tar.gz file. Two options come to mind to get the file, both using a box connected to the internet to download the code:
- do
npm install db-oracle, then copy the packaged .tar.gz out of the cache directory ("~/.npm/db-oracle/0.2.3/package.tgz") - clone this repository and the submodule repository, then run npm package:
$ git clone https://github.com/mariano/node-db-oracle.git
$ cd node-db-oracle
$ git submodule init && git submodule update
$ npm pack
You'll then have a "db-oracle-0.2.3.tgz" in the current directory.
@raztus is the same working for https://github.com/nearinfinity/node-oracle? I noticed you have been using both packages, which one do you recommand?
I don't have enough experience to really recommend one over the other, and we are currently using both libraries in my organization. What is clear is that mariano has ignored pull requests on this repository for at least 2 years, while joeferner has been actively accepting pull requests on his repo. Neither author is actively coding on these projects (though mariano is still active on the second part of this package, node-db).
In my private fork of node-db-oracle I have gotten it to build on Node 10 using node-gyp, and it seems to work fine. However, node-oracle has a few more features I need (TNS names, some CLOB support) and development in the forks seems a bit more active.
@raztus I want to use your fork and edit bindings to support lnnz12
Is this the only installation method?
$ git clone https://github.com/raztus/node-db-oracle.git
$ cd node-db-oracle
$ git submodule init && git submodule update
$ npm install
but I want to add git dependency to your fork in my own npm module, what happens to submodule init && git submodule update !?
How can i use preinstall to automatically install db-oracle from your fork?
There have been a few attempts to do what you're asking; that is, have npm install automatically install an npm module that contains git submodulest:
https://github.com/spiralsphere/node-db-oracle/commit/e07103c1e9c7c81f49f2f258710401f04c4332cc
And more information on this approach:
http://stackoverflow.com/questions/9543701/npm-install-forked-git-with-submodule
Unfortunately, it sounds like there isn't really a good solution to do exactly what you want. Your best bet is to follow the first steps you listed (git clone, git submodule init/update, npm install) then to run npm pack to generate the file db-oracle-0.2.3.tgz. You can then put this tar file up on some server that your package will have access to, or include it in your code itself, and add it as a dependency in your package.json:
"dependencies": {
"db-oracle": "http://mycompany.com/db-oracle-0.2.3.tgz"
}
See: https://npmjs.org/doc/json.html#URLs-as-Dependencies
thank you @raztus for your clean answer, but that way what happens to building native packages!?
- do npm install in my package run npm install when using a url dependency? so that natives get built
- including it in my own code is not safe, so no npm install can be preformed!
- Spiralsphere's package.json has the dependency: https://github.com/spiralsphere/node-db-oracle/commit/e07103c1e9c7c81f49f2f258710401f04c4332cc#L0R27, but yours has not! This may solve the issue, since forces npm to fetch that but copying into node_modules!!!!? huh!?
- Yes,
npm installwill also install url dependencies, if specified in your package.json. - You're right, I assumed you could do something like
"db-oracle": "file://db-oracle-0.2.3.tgz", but it looks like you cannot usefile://. - The code at https://github.com/spiralsphere/node-db-oracle/commit/e07103c1e9c7c81f49f2f258710401f04c4332cc will not work properly. I was only presenting it as an example of what has been tried.