The reason I choose to do that is because I usually have to work with multiple applications that need require different Node.js versions, and using a node version manager (NVM) it is very easy to switch versions. I usually prefer to use a Node Version Manager to install Node.js. Some ways to replace NPM NPM Install -G CNPM -Registry = https: // had recently purchased a Windows 10 laptop and I wanted to install Node.js. Add NPM_HOME = E: \ DEV \ NVM \ NPM to the user variable, add%npm-home%to the pathĦ. If you want to update the global NPM, first delete the global path (that is, the previous line The address of the command can be viewed with npm config ls), and then execute this command againģ. NPM Install npm -g -registry = // Install the global NPM, different node uses this NPM. NPM Config Set Prefix "E: \ DEV \ NVM \ NPM" // Configure the package path installed in the global installation when downloading the packageĢ. Simple three steps can configure a global NPM. If there is a NPM that allows each version of Node to shareIt won't be so troublesome, which is why we have to configure a global NPM. Because NVM can manage multiple versions of Node, if you add a Node version each time you need to install a bunch of bags, it is troublesome. When installing Node, NPM has actually been installed together. Nvm ls // View Nodejs version that has been installed Nvm use 8.12.0 // Use a specified version NVM Install 8.12.0 // Download the designated version NVM Install Latest Install the latest version Install Node through NVM nvm -v // View nvm version PATH:%NVM_HOME% %NVM_SYMLINK%(PATH has stored is added to the end)Ĥ. My computer-> attribute-> advanced system settings-> environment variables, add environment variables to user variables: NVM_HOME:E:\dev\nvm For E: \ dev \ nodejs, modify the contents of settings.txt as: root: E:\dev\nvm Select the NVM installation directory as E: \ DEV \ NVM, node installation directory directory. First decompress the nvm-setup.zip to such as E:/DEV/NVM (other disk can also be) then run NVM-SETUP as an administrator.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |