Javascript Package - Global Package (Cli)

About

There are two type of packages.

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

They are managed with the npm cli.

Management

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>

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.

Uninstall

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

List

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

Documentation / Reference





Discover More
Browsersync.io

Browser Sync serves the content, detects changes, refreshes the browser, and offers many customization's. How to use it to develop with live reloading. The reload will work: for the builtin web server...
Javascript Package

in Javascript. A Package is a distribution format that wraps: one or several Module. along side the package.json (called a manifest) which describes the package (its version, ...) npmpackage.json...
Javascript Package - Local Package

A local package is a package installed locally into your project. global npm install will create the node_modules directory in the current directory (if one doesn't exist yet), and will download...
WebPack - Installation

Webpack is just a global npm package. With or Local to the project Global Cli



Share this page:
Follow us:
Task Runner