Windows

MSI 包安装

  • Node-LTS-14.15.3
  • Node-Latest-15.4.0
  • 双击安装

    Scoop 安装

  • scoop install nodejs

    nvm-windows 包管理器

    nvm-windows和Linux下的nvm不是一个项目

  • scoop install nvm

  • nvm list available 查看可安装版本
  • nvm install 14.15.3 安装上面查询的版本

    nvm-windows 常见用法

    1. Usage:
    2. nvm arch : Show if node is running in 32 or 64 bit mode.
    3. nvm install <version> [arch] : The version can be a node.js version or "latest" for the latest stable version.
    4. Optionally specify whether to install the 32 or 64 bit version (defaults to system arch).
    5. Set [arch] to "all" to install 32 AND 64 bit versions.
    6. Add --insecure to the end of this command to bypass SSL validation of the remote download server.
    7. nvm list [available] : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
    8. nvm on : Enable node.js version management.
    9. nvm off : Disable node.js version management.
    10. nvm proxy [url] : Set a proxy to use for downloads. Leave [url] blank to see the current proxy.
    11. Set [url] to "none" to remove the proxy.
    12. nvm node_mirror [url] : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
    13. nvm npm_mirror [url] : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
    14. nvm uninstall <version> : The version must be a specific version.
    15. nvm use [version] [arch] : Switch to use the specified version. Optionally specify 32/64bit architecture.
    16. nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.
    17. nvm root [path] : Set the directory where nvm should store different versions of node.js.
    18. If <path> is not set, the current root will be displayed.
    19. nvm version : Displays the current running version of nvm for Windows. Aliased as v.

    Linux

    yum install nodejs

    nvm 包管理器

    ```shell

    下载

    wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

配置zsh

export NVM_DIR=”$([ -z “${XDG_CONFIG_HOME-}” ] && printf %s “${HOME}/.nvm” || printf %s “${XDG_CONFIG_HOME}/nvm”)” [ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm

  1. <a name="U5sxz"></a>
  2. #### nvm 常见用法
  3. ```shell
  4. - Install a specific version of Node.js:
  5. nvm install node_version
  6. - Use a specific version of Node.js in the current shell:
  7. nvm use node_version
  8. - Set the default Node.js version:
  9. nvm alias default node_version
  10. - List all available Node.js versions and highlight the default one:
  11. nvm list
  12. - Uninstall a given Node.js version:
  13. nvm uninstall node_version
  14. - Launch the REPL of a specific version of Node.js:
  15. nvm run node_version --version
  16. - Execute a script in a specific version of Node.js:
  17. nvm exec node_version node app.js

更多用法查看nvm 官网