nodeenv
nodeenv copied to clipboard
Add support for a .node-version file
It would be nice to be able to install the node version specified in .node-version (similar to some Python and Ruby and environment managers). I don't think .nvmrc, which is used by nvm is a good choice, because it's tied to the nvm branding.
@ekalinin Any update?
Hey @nikolay Sorry for delay.
Did you try .nodeenvrc?
- https://github.com/ekalinin/nodeenv#configuration
Default values are:
➥ nodeenv --dump-config-defaults
[nodeenv]
debug = False
jobs = 2
make = make
node = latest
npm = latest
prebuilt = False
profile = False
with_npm = False
without_ssl = False
Hi @ekalinin, this would be very useful for me as well, the main reason not to use .nodeenvrc would be to have the node version specified by the repository. If it lives at ~/.nodeenvrc it has to be the same for all environments. Or perhaps .nodeenvrc from the current folder could be used first if it exists?
@ekalinin I know that, but it is global per user - I need this per project. I have a per project virtualenv where I install nodeenv and thus I want the Node.js version to be specific for that virtualenv/project as well, not be globally configured as different projects may use different versions. There could be a hierarchy of the checks - project's home folder first, then in $HOME, then globally.
@ekalinin right, it would be very useful, specially if you think about a way to start contributing to a project: instead to know what version of node you should install, simply creating the virtual env the right version is automatically installed.
Furthermore, I suggest to use node engines, using the most newer version in range, instead a new and separate config file.
Could we open a pull request?
I see support for .node-version file was added in #288
For interest, I have been documenting node version managers which read .node-version file:
https://github.com/shadowspawn/node-version-usage