DEV Community

Discussion on: How to run multiple Node and Angular versions simultaneously

Collapse
 
clementmwendwa profile image
Clement Mwendwa

Why use nvm execute when you could just use npm? Considering you've switched the node versions already.

Collapse
 
patricepeartree profile image
Patrícia Pereira • Edited

By "switched the node versions already" do you mean executed nvm use [version]? Because if so, then when you open a new terminal, the version nvm will be using will no longer be the one you just defined. It will be the one to which the nvm default alias is pointing to.

The combination .nvmrc file + nvm exec/nvm run avoids having to run nvm use every time.

Collapse
 
clementmwendwa profile image
Clement Mwendwa

Got you, yeah meant after nvm use. For what it's worth though there's a tool to automatically switch versions when you have a .npmrc file
github.com/wbyoung/avn, you could have a script to do that as well.