Window system configuration nvm management tool

Reference: https://www.cnblogs.com/jing-tian/p/11225123.html

It is recommended to install the nvm environment directly and then install the node in order to facilitate the future development process, to be compatible with the node version of the new and old projects. It does not matter if the node environment is already installed in the computer. Will not conflict

  1. nvm-windows latest download address: https://github.com/coreybutler/nvm-windows/releases
    you can see that there are four more downloadable files here.
    nvm-noinstall.zip: This is a green free installation version, but you need to configure before use
    nvm-setup.zip: This is an installation package, click install after downloading, you can use it without configuration, which is convenient.
    Source code(zip): source
    code compressed by zip Sourc code(tar.gz): source code of tar.gz, generally used in *nix system.
    I currently just use this for simplicity, for convenience, so I downloaded the nvm-set.zip file .
    Insert picture description here
  2. Download the decompressed package and click to install
    . The first installation directory: The default installation directory is not used here. Modify the installation directory to D:\system\nvm; readers can decide the installation directory by themselves. The
    Insert picture description here
    second installation directory: add node.js installation manual
    Note:
    The term "add node.js installation directory" here is actually not accurate. The accurate statement should be that the installation directory of node.js will be configured
    to use the C:\Program Files\nodejs directory by default, C:\Program Files\ The nodejs directory is also the default installation directory of node.js.
    If the reader has installed node.js before installing nvm and modified the installation directory of node.js, then the directory here should be modified to the installation directory of node.js.
    If readers Node.js is not installed before installing nvm, then the directory here can be self-defined

    Insert picture description here
    – I have already installed node here, and the installation path is D:\system\nodejs, so I need to modify it here
    . The installation directory of my node is D:\system\nodejs
    – Click Install, and it will pop up during the installation process: Since node has been installed, it prompts "Do you want nvm to manage the installed node version?", click Yes, after the installation is complete, test whether the installation is successful; command: nvm -v
    – If the nvm version number and a series of help commands appear, then It shows that the nvm installation is successful.
    Otherwise, it may prompt nvm: command not found
  3. Command usage
    nvm for windows is a command line tool. Enter nvm in the console and you can see its command usage. The basic commands are:
    nvm arch [32|64] :display node is running in 32-bit or 64-bit mode. Specify 32 or 64 to override the default architecture.
    nvm install <version> [arch]:This can be the node.js version or the latest stable version latest. (Optional [arch]) Specify to install the 32-bit or 64-bit version (the default is the system arch). Set [arch] to all to install 32- and 64-bit versions. Add –insecure after the command to bypass the SSL verification of the remote download server.
    nvm list [available]:List the installed version of node.js. Optional available, which displays a partial list of downloadable versions. This command can be abbreviated as nvm ls [available].
    nvm on:Enable node.js version management.
    nvm off:Disable node.js version management (do not uninstall anything) and
    nvm proxy [url]:set the proxy for downloading. Leave [url] blank to view the current proxy. Set [url] to none to delete the proxy.
    nvm node_mirror [url]:Set the node mirror, the default is https://nodejs.org/dist/. I suggest to set the mirror of Taobao https://npm.taobao.org/mirrors/node/ to
    nvm npm_mirror [url]:set the npm mirror, the default is https://github.com/npm/npm/archive/. I recommend setting it as Taobao's mirror https://npm.taobao.org/mirrors/npm/ to
    nvm uninstall <version>:uninstall the specified version of nodejs.
    nvm use [version] [arch]:Switch to use the specified nodejs version. You can specify 32/64 bit [arch]. nvm use will continue to use the selected version, but switch to the
    nvm root [path]:setting of 32/64-bit mode according to the provided value. nvm stores the directory of different versions of node.js. If it is not set, the current directory will be used.
    nvm version:Display the currently running version of nvm, which can be abbreviated as nvm v
  4. Common examples
    nvm list  // view the currently installed version
    nvm list available// display a partial list of downloadable versions
    nvm install 10.15.0// install the specified version of nodejs
    nvm use 10.15.0// use the specified version of nodejs
    npm install -g cnpm --registry=https://registry.npm.taobao.org// use Taobao mirror
Note: Changing the npm mirror to Taobao’s mirror can increase the download speed.
Note: The installation path of nvm and nodejs must not have Chinese or spaces, otherwise an error or garbled code will be reported when switching the version

Guess you like

Origin blog.csdn.net/weixin_43996999/article/details/104305476