nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
78.56k stars 7.87k forks source link

Custom node installation location in .nvmrc #1692

Open VitGottwald opened 6 years ago

VitGottwald commented 6 years ago

Feature request: Could nvmrc point to a local path where a custom node version is installed? When nvm would be run it would simply witch the path to that location.

This would be useful when using https://github.com/eirslett/frontend-maven-plugin which downloads and installs a version of node as specified in maven's pom.xml.

ljharb commented 6 years ago

Other than system, nvm manages its own node versions.

If you want a maven plugin to install a version of node for you, you may want to configure the installation location to be nvm_version_path 4.5.6 (or whichever version); however it'd be better to let nvm do the installing.

VitGottwald commented 6 years ago

I would love to leave the install tonvm, but our build process is driven by maven and it does the installation into a directory within the repo.

It would be great if we could use nvm in some way to set the proper path to the custom location so that we could use nvm and node as we are used to from javascript projects.

ljharb commented 6 years ago

Instead of using maven to install node, could you configure maven to run arbitrary commands?

VitGottwald commented 6 years ago

That should be possible. It would have to be separate profile and hence would be different build process compared to CI. But that should be ok. Are you suggesting to set up a .nvmrc to the same version as maven's pom.xml specifies and simply call nvm use from maven?

ljharb commented 6 years ago

Yes.