Reputation: 4168
I'm digging into a node package that uses a CLI, and am trying to extend it by adding some functionality. I've cloned the repo from github, but I've also installed it via npm.
How can I use my local version, instead of the one that's been installed via npm?
Thanks!
Upvotes: 1
Views: 740
Reputation: 8820
When you install a package using npm, it just puts it into the node_modules folder in the folder where you ran it (or if you pass -g, into a global node_modules folder).
require() uses a particular search order to find modules. To get a specific version of a module to load you can take two paths:
For more information, take a look at http://nodejs.org/docs/v0.4.11/api/modules.html
Upvotes: 2