Windows10 install nvm problem

Time:2022-8-8

Problem Description

  • Record the various problems and solutions encountered after installing nvm on Windows 10 for reference

installation steps

1. nvm address
2. Install nvm
  • Download the installation package to the specified location and follow the prompt steps

    1. Windows10 install nvm problem
    2. Windows10 install nvm problem
    3. Windows10 install nvm problem
    4. The installation process will prompt you whether to include the node version currently in use under nvm management, and you can choose to agree.
    5. There is no need to configure additional environment variables, and no need to uninstall the node in use in the computer (this depends on the situation)
3. Check the installation
  • Check if the installation is successful: open cmd and enternvmOutput the current nvm version and the installation is successful
    Windows10 install nvm problem
4. nvm basic commands
  • nvm -hJust remember this command, and a list of nvm commands will pop up
    Windows10 install nvm problem

problem and solution

Question 1:nvm use node version numbercommand error

Windows10 install nvm problem

  • Open cmd with administrator privileges and enter the switch node version command
Question 2:npm install dependency namecommand error

Windows10 install nvm problem

  • vscode lacks admin rights:

    1. Right click vscode shortcut => Properties => Compatibility => Run this program as administrator
      Windows10 install nvm problem
    2. Open powershell with administrator privileges => get the current execution policy command:get-ExecutionPolicy=> Set the execution policy:Set-ExecutionPolicy RemoteSigned => Y
      Windows10 install nvm problem
      Windows10 install nvm problem
    3. restart vscode
Question 3:vue add plugin namecommand error

Windows10 install nvm problem

  • Install vuecli for each version of node:

    1. Install vueclinpm install -g @vue/cli
      Windows10 install nvm problem
    2. Check the installation version and output the installation version to be successfulvue -V
    3. If the vue command is used in cmd to report an error and the vue command cannot be recognized, you need to configure the environment variables

      Find the location of the vue.cmd file globally (listary software is recommended), copy the vue.cmd path to the system environment variable and add it; after the operation is completed, it is recommended to restart vscode or the computer

Related Links

nvm:https://github.com/coreybutle…
nodejs:https://nodejs.org/en/
vuecli:https://cli.vuejs.org/zh/guid…