baddex.blogg.se

Install nvm for windows
Install nvm for windows









NVM for Windows is not a perfect solution, but it works well enough to make it easier to work with different versions of Node.js on Windows.

install nvm for windows

It's far from perfect, but it works well enough for me and required minimal effort to make it work. nvmrc file and switch to the correct version of Node.js: Function Nvm-UseFromNvmrc Since the projects I work on only use the nvm/* syntax, I created the following helper function to parse the contents of the. Unfortunately, this is not supported by NVM for Windows. Then you can switch to the correct version simply by calling: nvm use nvmrc file in the root folder of a project to specify the version you need. The Linux/macOS version of nvm supports a. There was one last thing that was bugging me. Now I can just call one of those functions to switch to a different Node.js version: Nvm-Use10 Start-Process -Verb RunAs nvm -Args "use 16.13.0" Start-Process -Verb RunAs nvm -Args "use 14.18.1" Start-Process -Verb RunAs nvm -Args "use 12.22.7" Start-Process -Verb RunAs nvm -Args "use 10.24.1" The syntax is a bit complicated, so I created a few functions in my PowerShell profile to make the command easier to use: Function Nvm-Use10 I decided to use the Start-Process PowerShell command as a workaround: Start-Process -Verb RunAs nvm -Args "use 10.24.1" I am not comfortable having admin privileges in my terminal, and I wanted to avoid having to open another terminal window when I want to switch to a different Node.js version.

install nvm for windows

The official recommendation is to use the tool from an admin terminal window. This is because the tool uses symlinks that require admin privileges to create. It was time to switch to one of these versions and start working: nvm use 10.24. I then installed all the Node.js versions that I might need to use in the near future: nvm install 10.24. After I restarted the terminal window, the nvm command was available to me.

install nvm for windows

When I was done with that, I downloaded nvm-setup.zip from the NVM for Windows releases page and ran the installer from that archive.

  • Deleting the npm and npm-cache folders from the %appdata% folder.
  • Uninstalling Node.js from the Windows Programs & Features window.
  • Clearing the npm cache by calling npm cache clean -force.
  • I followed a great guide I found on Stack Overflow. Since I already had Node.js installed on my machine, it seemed like a good idea to do a full uninstall first. When I realized that I would also need to downgrade my Node.js installation, I decided to bite the bullet and install NVM for Windows. At first, it seemed like downgrading npm would suffice. I have been working on older Ionic Angular projects lately that can not be built with the latest version of Node.js.











    Install nvm for windows