Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

GruntJS/NPM package.json : installing from local?

GruntJS/NPM package.json : installing from local?

Problem

With GruntJS/NPM package.json

If I've cloned an module from github to local, how can I reference that in my package.json so it installs from the local version?

Problem courtesy of: user537339

Solution

You could create a forked version of the original repo on Github, and reference your Github URL in package.json. You can even specify a branch or tag while you wait for upstream to accept any patches you may have.

"dependencies": {
  "my-task": "git://github.com/username/repo.git#branch"
}

Or, you can use npm link to reference a project located on your hard drive. This works fine if you're the only developer, but deployment will be a bit more tricky regardless. (the option above is byfar the best one)

Solution courtesy of: Dominic Barnes

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

GruntJS/NPM package.json : installing from local?

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×