Node Package Manager or simply NPM is a package manager most widely used in conjunction with Node.JS and many other Javascript. NPM is used because it gives exceptional control over the dependencies in the project.
# Install a Package
$ npm install
# Install Specific version of a package
$ npm install @version
$ npm install abcd@1.2.3
COMMAND LINE OPTIONS:
Command-line is where we spend most of our time, and <strong>npm</strong> the command line is very powerful and the following are a few things about the npm command-line options. NPM documentation is the ultimate location to get end-to-end information about the command-line options. Following are the most widely used commands;
install:
This command will install a package and any package that depends on. Following are the options available
COMMAND LINE OPTIONS:
Command-line is where we spend most of our time, and <strong>npm</strong> the command line is very powerful and the following are a few things about the npm command-line options. NPM documentation is the ultimate location to get end-to-end information about the command-line options. Following are the most widely used commands;
install:
This command will install a package and any package that depends on. Following are the options available

access:
This command will allow you to set access control on a private package, subcommands available are public, restricted, grant, revoke, ls-packages, ls-collaborators, and edit
This command will allow you to set access control on a private package, subcommands available are public, restricted, grant, revoke, ls-packages, ls-collaborators, and edit

bin:
This command will print out the location where npm will install executables



This command will print out the location where npm will install executables



cache:
This command is Used to add, list, or clean the npm cache folder.


This command is Used to add, list, or clean the npm cache folder.


config:
npm gets its config settings from the command line, environment variables, npmrcfiles, and in some cases, the package.json file.
npm gets its config settings from the command line, environment variables, npmrcfiles, and in some cases, the package.json file.

dedupe:
The deduplication algorithm walks the tree, moving each dependency as far up in the tree as possible, even if duplicates are not found. This will result in both a flat and deduplicated tree.
The deduplication algorithm walks the tree, moving each dependency as far up in the tree as possible, even if duplicates are not found. This will result in both a flat and deduplicated tree.

doctor:
npm doctor runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages. npm is mostly a standalone tool, but it does have some basic requirements that must be met:
npm doctor runs a set of checks to ensure that your npm installation has what it needs to manage your JavaScript packages. npm is mostly a standalone tool, but it does have some basic requirements that must be met:
- Node.js and git must be executable by npm.
- The primary npm registry, registry.npmjs.com, or another service that uses the registry API, is available.
- The directories that npm uses, node_modules (both locally and globally), exist and can be written by the current user.
- The npm cache exists, and the package tarballs within it aren’t corrupt.

No comments:
Post a Comment
If you have any doubts or questions, please let us know.