Javascript - npm (Node package manager)

About

Npm is the package manager that is packaged/installed with a node installation.

Management

Installation

Update

To update npm self, execute the following statement:

npm install [email protected] -g
C:\Users\gerard\AppData\Roaming\npm\npm -> C:\Users\gerard\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
C:\Users\gerard\AppData\Roaming\npm
`-- [email protected]
  +-- [email protected]
  +-- [email protected]
  +-- [email protected]
........................

Version

npm -v
4.5.0

Script

Config

npm gets its config settings from:

  • the command line,
  • environment variables,

The npm config command can be used to update and edit the contents of the user and global npmrc files.

Environment variable

Npm reads configuration from any environment variables beginning with NPM_CONFIG.

Config file ( .npmrc)

The .npmrc file is in your project’s root.

npm config get userconfig   # defaults to ~/.npmrc 
C:\Users\gerard\.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc 
C:\Users\gerard\AppData\Roaming\npm\etc\npmrc

Registry

web:javascript:package:registry

npm config get registry
https://registry.npmjs.org/

Default Directory

npm config get prefix
C:\Users\gerard\AppData\Roaming\npm

Documentation / Reference


Powered by ComboStrap