nvm 命令用法

三葉Leaves Author

安装过程请见:安装 node.js & npm & nvm

常用命令

安装最新的 LTS 版本的 nodejs

1
nvm install lts

使用某一个版本的 nodejs (比如 22):

1
nvm use 22

切换镜像源(中国用户很受用):

下面的镜像源地址具有时效性,若失效请替换

1
nvm node_mirror https://npmmirror.com/mirrors/node/
1
nvm npm_mirror https://npmmirror.com/mirrors/npm/

详细命令

以下 Usage 由 nvm for windows 的作者给出

  • nvm arch [32|64]: Show if node is running in 32 or 64 bit mode. Specify 32 or 64 to override the default architecture.
  • nvm debug: Check the NVM4W process for known problems.
  • nvm current: Display active version.
  • nvm install <version> [arch]: The version can be a specific version, “latest” for the latest current version, or “lts” for the most recent LTS version. Optionally specify whether to install the 32 or 64 bit version (defaults to system arch). Set [arch] to “all” to install 32 AND 64 bit versions. Add to the end of this command to bypass SSL validation of the remote download server.--insecure
  • nvm list [available]: List the node.js installations. Type at the end to show a list of versions available for download.available
  • nvm on: Enable node.js version management.
  • nvm off: Disable node.js version management (does not uninstall anything).
  • nvm proxy [url]: Set a proxy to use for downloads. Leave blank to see the current proxy. Set to “none” to remove the proxy.[url]``[url]
  • nvm uninstall <version>: Uninstall a specific version.
  • nvm use <version> [arch]: Switch to use the specified version. Optionally use , , or . is the latest installed version. Optionally specify 32/64bit architecture. will continue using the selected version, but switch to 32/64 bit mode. For information about using in a specific directory (or using ), please refer to issue #16.latest``lts``newest``newest``nvm use <arch>``use``.nvmrc
  • nvm root <path>: Set the directory where nvm should store different versions of node.js. If is not set, the current root will be displayed.<path>
  • nvm version: Displays the current running version of NVM for Windows.
  • nvm node_mirror <node_mirror_url>: Set the node mirror. People in China can use https://npmmirror.com/mirrors/node/
  • nvm npm_mirror <npm_mirror_url>: Set the npm mirror. People in China can use https://npmmirror.com/mirrors/npm/
  • 标题: nvm 命令用法
  • 作者: 三葉Leaves
  • 创建于 : 2024-12-05 00:00:00
  • 更新于 : 2025-01-05 18:48:33
  • 链接: https://kiss1314.top/d5e6d498f87c/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论