node-db-oracle icon indicating copy to clipboard operation
node-db-oracle copied to clipboard

The db-oracle could be install off-line?

Open poston opened this issue 12 years ago • 7 comments

Because the company cannot connect internet, the db-oracle how to install off-line

poston avatar Jul 10 '13 03:07 poston

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:

  1. do npm install db-oracle, then copy the packaged .tar.gz out of the cache directory ("~/.npm/db-oracle/0.2.3/package.tgz")
  2. 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.

johannish avatar Jul 19 '13 19:07 johannish

@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?

behrad avatar Jul 20 '13 20:07 behrad

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.

johannish avatar Jul 22 '13 19:07 johannish

@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?

behrad avatar Aug 06 '13 14:08 behrad

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

johannish avatar Aug 06 '13 16:08 johannish

thank you @raztus for your clean answer, but that way what happens to building native packages!?

  1. do npm install in my package run npm install when using a url dependency? so that natives get built
  2. including it in my own code is not safe, so no npm install can be preformed!
  3. 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!?

behrad avatar Aug 06 '13 17:08 behrad

  1. Yes, npm install will also install url dependencies, if specified in your package.json.
  2. 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 use file://.
  3. 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.

johannish avatar Aug 06 '13 19:08 johannish