Node - Global Package (Cli)

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

1 - About

There are two type of npm packages.

This article goes over the global package (for the whole OS).

They are managed with the npm cli.

Advertising

3 - Management

3.1 - Installation

  • Yarn (in Windows home\AppData\Local\Yarn\bin\) from the registry
yar global install package
  • Yarn from a local package
yarn global add file:%cd%\packages\mypackage
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - mypackage
Done in 27.00s.
  • Npm (windows: home\AppData\Roaming\npm)
npm install -g <package>

3.2 - Update

yarn global add <package>@version
# or npm
npm update -g <package>@version

To find out which packages need to be updated, you can use

npm outdated -g --depth=0.

3.3 - Uninstall

yarn global remove now
# or 
npm uninstall -g <package>

3.4 - List

# List all
npm list -g
# List one
npm list -g <package>
# Example
npm list -g create-react-app

4 - Documentation / Reference

Advertising
web/javascript/npm/package_global.txt · Last modified: 2019/05/12 14:45 by gerardnico