0

I'm using nTwitter to access twitter api using node. However, there is a bug in the search utility, and someone already forked and fixed it, but it wasn't pulled yet.

How can I use the fixed version s.t all my team will have the fixed version (meaning, just fixing it locally won't do the trick), but still use it as an npm module? can it be done at all?

Yossale
  • 14,165
  • 22
  • 82
  • 109

2 Answers2

2

Install that commit like this:

npm install git://github.com/AvianFlu/ntwitter#e496bc07b9d0138f65902a43bc267796ab1a74d1

Or install using package.json:

{
  ....
  "dependencies": {
    ....
    "ntwitter" : "git://github.com/AvianFlu/ntwitter#e496bc07b9d0138f65902a43bc267796ab1a74d1"
  }
}
damphat
  • 18,246
  • 8
  • 45
  • 59
2
  1. You can set up a private npm repository and upload your package there under a unique version, something like 1.2.5-yourcompanyname, so it'll be installed instead for everyone who is using this registry.

    Pros: it works just like npm registry for everyone who is using it

    Cons: it is usable only in closed groups, i.e. within a team or a company

  2. You can set up a git dependency as damphat pointed out.

    Pros: it will work for most of the people out of the box

    Cons: it will require git to be installed on every user's machine

  3. You can check it to your git repository either as a submodule or just like regular files. Use bundleDependencies when you're publishing it.

    Pros: faster to install, and usually work for everyone

    Cons: takes up space in git repository, longer checkouts, etc.

We went for the first solution, and usually are trying to avoid second one because we don't have git on production. Third one is quite popular as well.

alex
  • 11,935
  • 3
  • 30
  • 42