Tuesday, 29 March 2016

How to manage modules using npm ?


$ npm install <Module Name> [-g]
$ npm uninstall <Module Name>
$ npm update <Module Name>
$ npm ls
$ npm search <Module Name>

Example Install module "express" locally (in your application direcory)
$ npm install express
All the modules installed goes to node_modules directory

In order to use this installed package in your application (JS) :
var express_module = require('express');


Example Install module "express" globally (in system directory /usr/lib )
$ npm install express -g


Example List modules
$ npm ls

Example Search modules
$ npm search express
Example Uninstall module "express"
$ npm uninstall express


Example Update module "express"
$ npm update express


No comments:

Post a Comment

Note: only a member of this blog may post a comment.