latvian
latvian

Reputation: 3225

configure custom module for Node.js project

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.

  1. update package.json with dependency:

    ... "dependencies": { "rest-client": "*" }, ...

  2. create dir node_modules in my project

  3. Copy the rest-client into the directory 'node_modules'
  4. 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

Upvotes: 1

Views: 1285

Answers (1)

Alexander Varwijk
Alexander Varwijk

Reputation: 2083

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.

Upvotes: 2

Related Questions