Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

npm

npm22.7mArtistic-2.011.0.0TypeScript support: included

a package manager for JavaScript

install, modules, package manager, package.json

readme

npm - a JavaScript package manager

Requirements

You should be running a currently supported version of Node.js to run npm. For a list of which versions of Node.js are currently supported, please see the Node.js releases page.

Installation

npm comes bundled with node, & most third-party distributions, by default. Officially supported downloads/distributions can be found at: nodejs.org/en/download

Direct Download

You can download & install npm directly from npmjs.com using our custom install.sh script:

curl -qL https://www.npmjs.com/install.sh | sh

Node Version Managers

If you're looking to manage multiple versions of Node.js &/or npm, consider using a node version manager

Usage

npm <command>
  • Documentation - Official docs & how-tos for all things npm
    • Note: you can also search docs locally with npm help-search <query>
  • Bug Tracker - Search or submit bugs against the CLI
  • Roadmap - Track & follow along with our public roadmap
  • Community Feedback and Discussions - Contribute ideas & discussion around the npm registry, website & CLI
  • RFCs - Contribute ideas & specifications for the API/design of the npm CLI
  • Service Status - Monitor the current status & see incident reports for the website & registry
  • Project Status - See the health of all our maintained OSS projects in one view
  • Events Calendar - Keep track of our Open RFC calls, releases, meetups, conferences & more
  • Support - Experiencing problems with the npm website or registry? File a ticket here

Acknowledgments

  • npm is configured to use the npm Public Registry at https://registry.npmjs.org by default; Usage of this registry is subject to Terms of Use available at https://npmjs.com/policies/terms
  • You can configure npm to use any other compatible registry you prefer. You can read more about configuring third-party registries here

FAQ on Branding

Is it "npm" or "NPM" or "Npm"?

npm should never be capitalized unless it is being displayed in a location that is customarily all-capitals (ex. titles on man pages).

Is "npm" an acronym for "Node Package Manager"?

Contrary to popular belief, npm is not in fact an acronym for "Node Package Manager"; It is a recursive bacronymic abbreviation for "npm is not an acronym" (if the project was named "ninaa", then it would be an acronym). The precursor to npm was actually a bash utility named "pm", which was the shortform name of "pkgmakeinst" - a bash function that installed various things on various platforms. If npm were to ever have been considered an acronym, it would be as "node pm" or, potentially "new pm".

changelog

1.0.0 / 2024-08-31

  • Drop support for node <18
  • Added an option preferred encodings array #59

0.6.3 / 2022-01-22

  • Revert "Lazy-load modules from main entry point"

0.6.2 / 2019-04-29

  • Fix sorting charset, encoding, and language with extra parameters

0.6.1 / 2016-05-02

  • perf: improve Accept parsing speed
  • perf: improve Accept-Charset parsing speed
  • perf: improve Accept-Encoding parsing speed
  • perf: improve Accept-Language parsing speed

0.6.0 / 2015-09-29

  • Fix including type extensions in parameters in Accept parsing
  • Fix parsing Accept parameters with quoted equals
  • Fix parsing Accept parameters with quoted semicolons
  • Lazy-load modules from main entry point
  • perf: delay type concatenation until needed
  • perf: enable strict mode
  • perf: hoist regular expressions
  • perf: remove closures getting spec properties
  • perf: remove a closure from media type parsing
  • perf: remove property delete from media type parsing

0.5.3 / 2015-05-10

  • Fix media type parameter matching to be case-insensitive

0.5.2 / 2015-05-06

  • Fix comparing media types with quoted values
  • Fix splitting media types with quoted commas

0.5.1 / 2015-02-14

  • Fix preference sorting to be stable for long acceptable lists

0.5.0 / 2014-12-18

  • Fix list return order when large accepted list
  • Fix missing identity encoding when q=0 exists
  • Remove dynamic building of Negotiator class

0.4.9 / 2014-10-14

  • Fix error when media type has invalid parameter

0.4.8 / 2014-09-28

  • Fix all negotiations to be case-insensitive
  • Stable sort preferences of same quality according to client order
  • Support Node.js 0.6

0.4.7 / 2014-06-24

  • Handle invalid provided languages
  • Handle invalid provided media types

0.4.6 / 2014-06-11

  • Order by specificity when quality is the same

0.4.5 / 2014-05-29

  • Fix regression in empty header handling

0.4.4 / 2014-05-29

  • Fix behaviors when headers are not present

0.4.3 / 2014-04-16

  • Handle slashes on media params correctly

0.4.2 / 2014-02-28

  • Fix media type sorting
  • Handle media types params strictly

0.4.1 / 2014-01-16

  • Use most specific matches

0.4.0 / 2014-01-09

  • Remove preferred prefix from methods