5

When running an NPM script from the script explorer, it uses NVM's default version of node. Instead, I'd like to use the version dictated by .nvmrc. Is that possible?

Matt Davis
  • 462
  • 1
  • 7
  • 10

1 Answers1

0

There are several extensions that run nvm use on each terminal opened if an .nvmrc file is found in the workspace. These work for the NPM Script Explorer too.

The most downloaded one is called vsc-nvm.

In case it does not work out of the box, note that it runs nvm use in a /bin/sh shell, therefore you need to make sure nvm is accessible and works as intended from within sh.

P.S. This sounds like a good feature to add to the NPM Script Explorer itself, but as far as I can see, nobody suggested it yet.

Dorin Botan
  • 1,224
  • 8
  • 19