4

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?

user537339
  • 1,851
  • 2
  • 15
  • 19
  • I found this: http://stackoverflow.com/questions/7575627/can-you-host-a-private-repository-for-your-organization-to-use-with-npm Except it seems too much. I just want to point to a cloned git directory. – user537339 Mar 10 '13 at 09:25

1 Answers1

4

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)

Dominic Barnes
  • 28,083
  • 8
  • 65
  • 90