Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm: add Chinese translation #15512

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions pages.zh/common/npm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# npm

> JavaScript 和 Node.js 包管理器。
> 管理 Node.js 项目及其模块依赖项。
> 更多信息:<https://www.npmjs.com>.

- 使用默认值创建一个 `package.json` 文件(省略 `--yes` 以交互方式执行):

`npm init {{-y|--yes}}`

- 下载 `package.json` 中列出的所有依赖项包:

`npm install`

- 下载包的特定版本并将其添加到 `package.json` 中的依赖项列表中:

`npm install {{包名}}@{{version}}`
witt-bit marked this conversation as resolved.
Show resolved Hide resolved

- 下载包的最新版本并将其添加到 `package.json` 中的开发依赖项列表中:

`npm install {{包名}} {{-D|--save-dev}}`

- 下载包的最新版本并全局安装:

`npm install {{-g|--global}} {{包名}}`

- 卸载包并将其从 `package.json` 中的依赖项列表中删除:

`npm uninstall {{包名}}`

- 列出所有本地安装的依赖项:

`npm list`

- 列出所有顶级全局安装的包:

`npm list {{-g|--global}} --depth {{0}}`
Loading