configure custom module for Node.js project
Problem
I create my Node project (npm init). In this project, i want to use Node REST Client from git hub https://github.com/dchester/node-rest-client.
update package.json with dependency:
... "dependencies": { "rest-client": "*" }, ...
create dir node_modules in my project
- Copy the rest-client into the directory 'node_modules'
- Run 'npm install' to install this dependency, however it doesn't. What am i doing wrong? how to properly install dependency that is not from npm central repo?
Thank You
Solution
It looks like you'll have to do it manually for every module. However as the accepted answer in How to install a Private Npm Module without my own registry? by Mihai points out, npm knows about git:
npm install git://github.com/visionmedia/express.git
furthermore, besides going into the directory and typing npm install
there it is possible to specify the path as argument:
npm install path/to/somedir
There's another useful answer in How to install a private NPM module without my own registry? where you can see you can also specify a url pointing to a tarball. I suggest you take a look at that thread.
Discussion
View additional discussion.