Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 1.02 KB

npm.md

File metadata and controls

17 lines (13 loc) · 1.02 KB

NPM/Yarn

Node Package Manager(npm) is a package management tool for NodeJS packages. Yarn is a newer, faster tool that does the same thing. NPM and Yarn are both installed in the drupal container.

Configuration

NodeJS packages are configured through package.json. Documentation for package.json is available here, but keep in mind that you are using NPM to manage dependencies, not to publish packages to NPM, so several features do not apply to your project (eg: the files section).

Running

Use yarn rather than npm - these two commands are equivalent, but yarn is faster, and the CircleCI build relies on a yarn.lock file that gets generated when you use yarn.

  • Install all dependencies: yarn install
  • Update dependencies to the latest versions: yarn upgrade
  • List outdated dependencies: yarn outdated
  • Add a new dependency: yarn add mypackage. This will add the package to package.json and install it right away.