Node - npm cli (Node package manager)

> (World Wide) Web - (W3|WWW) > Javascript (Js|ECMAScript) > Node - npm cli (Node package manager)

1 - About

Npm is the package manager of node.

See also: Javascript - Yarn

Advertising

3 - Management

3.1 - Installation

3.2 - Update

To update npm self, execute the following statement:

npm install npm@latest -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]
........................

3.3 - Version

npm -v
4.5.0

3.4 - 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.

Advertising

3.4.1 - Environment variable

Npm reads configuration from any environment variables beginning with NPM_CONFIG.

3.4.2 - 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

3.4.3 - Registry

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

3.4.4 - Default Directory

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

4 - Documentation / Reference

web/javascript/npm/npm.txt · Last modified: 2019/05/02 17:08 by gerardnico