-
Notifications
You must be signed in to change notification settings - Fork 4
Using Package Managers
Working with package managers makes it easier for developers to install dependencies of the usable code. Most of the package managers have command lines, and some of them also have user-interfaces. Here are list of package managers, which explains some details about what packages are for and when to use them:
Install Node.js first before using npm. Node uses custom packages built by developers for Node. Whether Node platform is installed on Apache server or Google App Engine, using Node packages (not Nodejs) in your website can become optional. Nodejs platform, however, wouldn't run on statically served sites unless configured.
npm
is the root command for communicating and getting the packages from Node Package Manager server. Without using Node, but just using its packages, there are ways to reuse the Node packages and compile them (using Grunt or Gulp on your local system before deployment).
To grab the Node packages automatically without installing the dependencies one by one, you may configure package.json to list all dependencies, and run npm install
on the command line. Otherwise, running npm install -g package-name
will allow installing specific packages globally along with its dependencies (wherein the developers who uploaded their packages to the Node Package Manager server have pre-created the package.json to install other dependencies automatically).
There are three ways to install packages using npm:
-
npm install -g package-name
for global (for using Node platform) -
npm install package-name --save
(to install locally) - manually configuring the package.json file (Run the
npm install
command after configuring manually).