Depend on a branch or tag using a git URL in a package.json?

hurrymaplelad picture hurrymaplelad · May 3, 2013 · Viewed 215.8k times · Source

Say I've forked a node module with a bugfix and I want to use my fixed version, on a feature branch of course, until the bugfix is merged and released.

How would I reference my fixed version in the dependencies of my package.json?

Answer

hurrymaplelad picture hurrymaplelad · May 3, 2013

From the npm docs:

git://github.com/<user>/<project>.git#<branch>

git://github.com/<user>/<project>.git#feature\/<branch>

As of NPM version 1.1.65, you can do this:

<user>/<project>#<branch>