cli README

The project's README from github.com/npm/cli. As one markdown file: README.md.

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>

Acknowledgments

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 an acronym for "Node Package Manager." It is a recursive backronymic abbreviation for "npm is not an acronym" (if the project were 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 ever considered an acronym, it would be as "node pm" or, potentially, "new pm".

cli (npm/cli)

Searching Database…

10.2K ·GitHub
这是什么?这是 npm 的源代码。npm 是 JavaScript 的默认包管理器,也就是你在项目里安装和管理各种包时所用的命令行工具。
这个仓库是 CLI 本身,还是 npm 的 registry 和网站?是 CLI 本身——也就是安装和管理包的客户端。npm 的 registry 和网站是独立的服务,而这个命令行程序就是用来和它们通信的。
怎么把 npm 装到我的电脑上?你很可能已经有了:npm 随 Node.js 以及大多数第三方发行版一起捆绑提供。如果没有,可以通过 npmjs.com 上的 install.sh 脚本安装,或者使用 Node 版本管理工具。
运行它需要特定版本的 Node.js 吗?需要——npm 要求使用目前仍在支持期内的 Node.js 版本;这个版本的 engines 字段要求 Node 22.22.2+、24.15.0+ 或 26+,所以旧版 Node 需要先升级。
npm 是 “Node Package Manager” 的缩写吗?不是——和很多人的想法相反,npm 是一个递归式的首字母缩略词:“npm is not an acronym”。它的前身是一个叫 “pm” 的 bash 工具,pm 是 pkgmakeinst 的缩写,用于在各种平台上安装各种东西。
应该写成 npm 还是 NPM?永远用小写:该项目要求 npm 不要大写,除非出现在习惯上全大写的场景中,比如 man 页面的标题。
Creator
npm
Size
175.3 MB
Stars
10.2K
Age
8y
Commits · 90 Days