Chicken detailed windows64 installation configuration nvm

Chicken detailed windows64 installation configuration nvm

  • Step by step Ha ~

  • First, delete the current nodejs computer

  • Then download nvm: https://github.com/coreybutler/nvm-windows/releases

  • I chose to download the 1.1.7 version of nvm-setup.zip archive

  • Extract from the archive after successful download is nvm-setup.exe executable file

  • Double-click the executable file to run the installation nvm

  • Note that the default installation path is C drive (system tray), in order not to take up too much of the C disk space, I modified the default installation path for the D drive

  • After a successful download cmd command line, run the command nvm -v, showing Running version xxx is the successful installation nvm

  • The next command line to run the command nvm where, outputs nvm.exe file in the current installation path of the computer, such as mine is D: \ nvm \ nvm.exe

  • Open the D: \ nvm folder, you will find there is nvm.exe and settings.txt and other files

  • Back cmd command line, run the command nvm ls can view installed can be used nodejs computer has current, of course, before the first step should have originally existed nodejs unload clean, otherwise you can not live now, at this time operating results should be recognized as No installations.

  • Then we can use nvm installation nodejs and npm

  • Because nodejs and npm servers are in foreign countries access speeds touching (I'm Chinese!), So I modified the default address nodejs and npm is Taobao mirroring, simply open the settings.txt file, and then add the following code at the end, save and to close the file

    node_mirror: https://npm.taobao.org/mirrors/node/
    npm_mirror: https://npm.taobao.org/mirrors/npm/
    
  • Back cmd command line, run the command nvm ls available to view nodejs current version can be installed, let's nvm you need to install nodejs happy to use it

  • I chose to install the latest version LTS long-term support version, the version I currently 12.16.1

  • cmd command line to run the command nvm install 12.16.1 began installing this version of nodejs

  • Until then run the command nvm ls will output 12.16.1 that the current computer has successfully installed the version number can be used for nodejs 12.16.1, but this time run the command node -v still does not work, after examination, no soft links nodejs folders and files in the directory at the same level of nvm folder

  • Then run cmd command nvm use 12.16.1, successfully make the current version of the computer to spend 12.16.1 nodejs, at this time, and nvm folder directory will generate the same level of nodejs folder soft link, the link points to the current use of soft a node version

  • At which time the run command is output nvm ls * 12.16.1 (Currently using 64-bit executable), i.e., the current version of the computer being used 12.16.1 nodejs

  • Finally, we can run separately from the command line node -v and npm -v command to see nodejs and npm version currently being used

  • We're done! But the fly in the ointment is that because you want to use nvm management nodejs, downright your own computer and reload the nodejs npm, then all global npm package before you install will no longer need to be reinstalled. For example, I run the following command to view the big picture of what are npm package

npm ls -g --depth 0

// 我的输出结果
D:\nodejs\node_global  // npm全局安装的包都默认存放在该目录下
`-- (empty)

Record it

  • 2020.03.05
  • Npm global command line module installed, XXX problem is not an internal or external command
  • First of all I see a bit of the current situation is as follows
    Here Insert Picture Description
  • I try to configure a global module about the installation of the storage path and cache path npm
    npm config set prefix "D:/nodejs/node_global"
    npm config set cache "D:/nodejs/node_cache"
    
  • The results are as follows
    Here Insert Picture Description
  • I then execute the following command and configuration environment variable
    Here Insert Picture Description
    Here Insert Picture Description
    Here Insert Picture Description
  • The problem is solved.
  • I hope for your help ~
Published 49 original articles · won praise 29 · views 1902

Guess you like

Origin blog.csdn.net/Brannua/article/details/104626751