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
?
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
?
On latest version of NPM you can just do:
npm install gitAuthor/gitRepo#tag
If the repo is a valid NPM package it will be auto-aliased in package.json as:
{ "NPMPackageName": "gitAuthor/gitRepo#tag" }
If you could add this to @justingordon 's answer there is no need for manual aliasing now !
If you want to use
devel
orfeature
branch, or you haven’t published a certain package to the NPM registry, or you can’t because it’s a private module, then you can point to agit://
URI instead of a version number in yourpackage.json
:The
#ref
portion is optional, and it can be a branch (likemaster
), tag (like0.0.1
) or a partial or full commit id.per @dantheta's comment:
So
Or for tag v1.12.0 on jscs:
Note, if you use npm --save, you'll get the longer git
From https://docs.npmjs.com/files/package.json#git-urls-as-dependencies
From the npm docs:
As of NPM version 1.1.65, you can do this: