Npm (software)

Original author(s) Isaac Z. Schlueter
Developer(s) Rebecca Turner, Kat Marchán, others
Initial release January 12, 2010; 8 years ago (2010-01-12)[1]
Stable release
6.1.0 / 17 May 2018; 59 days ago (2018-05-17)[2]
Repository Edit this at Wikidata
Written in JavaScript
License Artistic License 2.0

npm is a package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js. It consists of a command line client, also called npm, and an online database of public and paid-for private packages, called the npm registry. The registry is accessed via the client, and the available packages can be browsed and searched via the npm website. The package manager and the registry are managed by npm, Inc.


npm is written entirely in JavaScript and was developed by Isaac Z. Schlueter as a result of having "seen module packaging done terribly" and with inspiration from the shortcomings of other similar projects such as PEAR (PHP) and CPAN (Perl).[3]

Notable breakages

  • In March 2016, npm attracted press attention[4] after a package called left-pad, which was depended upon by many popular JavaScript packages, was unpublished as the result of a dispute.[5] Although the package was re-published 3 hours later,[6] it caused widespread disruption, leading npm to change its policies regarding unpublishing to prevent a similar event in the future.[7]
  • In February 2018, an issue was discovered in version 5.7.1 in which running 'sudo npm' on Linux systems would change the ownership of system files, permanently breaking the operating system.[8]
  • In July 2018, the npm credentials of a maintainer of the popular eslint-scope package were compromised resulting in a malicious release of eslint-scope, version 3.7.2. The malicious code copies the npm credentials of the machine running eslint-scope and uploads them to the attacker. [9]


npm is included as a recommended feature in Node.js installer.[10] npm consists of a command line client that interacts with a remote registry. It allows users to consume and distribute JavaScript modules that are available on the registry.[11] Packages on the registry are in CommonJS format and include a metadata file in JSON format.[12] Over 477,000 packages are available on the main npm registry.[13] The registry has no vetting process for submission, which means that packages found there can be low quality, insecure, or malicious.[12] Instead, npm relies on user reports to take down packages if they violate policies by being low quality, insecure or malicious.[14] npm exposes statistics including number of downloads and number of depending packages to assist developers in judging the quality of packages.[15]


npm can manage packages that are local dependencies of a particular project, as well as globally-installed JavaScript tools.[16] When used as a dependency manager for a local project, npm can install, in one command, all the dependencies of a project through the package.json file.[17] In the package.json file, each dependency can specify a range of valid versions using the semantic versioning scheme, allowing developers to auto-update their packages while at the same time avoiding unwanted breaking changes.[18] npm also provides version-bumping tools for developers to tag their packages with a particular version.[19] npm also provides the package-lock.json[20] file which has the entry of the exact version used by the project after evaluating semantic versioning in package.json.


There are a number of open-source alternatives to npm for installing modular JavaScript, including ied, pnpm, npm-install, npmd, and Yarn, the last of which was released by Facebook in October 2016.[21] They are all compatible with the public npm registry and use it by default, but provide different client-side experiences, usually focused on improving performance and determinism compared to the npm client.[22]

See also


  1. ^ "Earliest releases of npm". GitHub. Retrieved 2016. 
  2. ^ "Release v6.1.0 · npm/npm". GitHub. 2018-05-17. Archived from the original on 2018-06-03. Retrieved . 
  3. ^ Schlueter, Isaac Z. (25 March 2013). "Forget CommonJS. It's dead. **We are server side JavaScript.**". GitHub. 
  4. ^ Yegulalp, Serdar (23 March 2016). "How one yanked JavaScript package wreaked havoc". InfoWorld. Retrieved 2016. 
  5. ^ Williams, Chris. "How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript". The Register. Retrieved 2016. 
  6. ^ "kik, left-pad, and npm". Retrieved 2017. 
  7. ^ "changes to unpublish policy". Retrieved 2017. 
  8. ^ "Critical Linux filesystem permissions are being changed by latest version". GitHub. Retrieved 2018. 
  9. ^ "Virus in eslint-scope". 
  10. ^ Dierx, Peter (30 March 2016). "A Beginner's Guide to npm -- the Node Package Manager". sitepoint. Retrieved 2016. 
  11. ^ Ampersand.js. "Ampersand.js - Learn". Retrieved 2016. 
  12. ^ a b Ojamaa, Andres; Duuna, Karl (2012). "Assessing the Security of Node.js Platform". IEEE Xplore. Retrieved 2016. 
  13. ^ Kennedy, Hugh; DeVay, Paul. "Understanding npm". Nsight. Retrieved 2016. 
  14. ^ "npm Code of Conduct: acceptable package content". Retrieved 2017. 
  15. ^ Vorbach, Paul. "npm-stat: download statistics for NPM packages". 
  16. ^ Ellingwood, Justin. "How To Use npm to Manage Node.js Packages on a Linux Server". DigitalOcean. Retrieved 2016. 
  17. ^ "npm-install". docs.npmjs. Retrieved 2016. 
  18. ^ "semver". docs.npmjs. Retrieved 2016. 
  19. ^ "npm-version". docs.npm. Retrieved 2016. 
  20. ^ Koirala, Shivprasad (21 Aug 2017). "What is the need of package-lock.json in Node?". codeproject. 
  21. ^ "Hello, Yarn!". The npm Blog. 11 October 2016. Retrieved 2016. 
  22. ^ Katz, Yehuda (11 October 2016). "Why I'm working on Yarn". Retrieved 2016. 

External links

  This article uses material from the Wikipedia page available here. It is released under the Creative Commons Attribution-Share-Alike License 3.0.



Connect with defaultLogic
What We've Done
Led Digital Marketing Efforts of Top 500 e-Retailers.
Worked with Top Brands at Leading Agencies.
Successfully Managed Over $50 million in Digital Ad Spend.
Developed Strategies and Processes that Enabled Brands to Grow During an Economic Downturn.
Taught Advanced Internet Marketing Strategies at the graduate level.

Manage research, learning and skills at defaultLogic. Create an account using LinkedIn or facebook to manage and organize your Digital Marketing and Technology knowledge. defaultLogic works like a shopping cart for information -- helping you to save, discuss and share.

Visit defaultLogic's partner sites below: : Music Genres | Musicians | Musical Instruments | Music Industry
NCR Works : Retail Banking | Restaurant Industry | Retail Industry | Hospitality Industry

  Contact Us