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

configure custom module for Node.js project

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.

  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

Problem courtesy of: latvian

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.

Solution courtesy of: Alexander Varwijk

Discussion

View additional discussion.



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

Share the post

configure custom module for Node.js project

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×