Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should be the format of the '.node-version' file, and where should I place it?

Tags:

node.js

This file instructs NodeJS version managers (such as avn and nodenv, and I guess that there are more) - which node version to use.

However, I have not been able to find anywhere, which format this file should abide to.

For example, should it be a JSON file? And if yes, what keys and values should it contain?

Running node --version gives me v8.11.2.

Also, where exactly should I place this file? My hunch tells me that it should reside next the package.json file in each one of my repositories, is that correct?

like image 832
goodvibration Avatar asked Jan 28 '26 04:01

goodvibration


1 Answers

The .node-version file is read by multiple projects, but there is not a defined standard.

In my testing, the format that worked with every product is a three part version number on a single line with a unix line ending.

e.g.

8.11.2

I documented usage and some supported features here: https://github.com/shadowspawn/node-version-usage

like image 185
shadowspawn Avatar answered Jan 31 '26 00:01

shadowspawn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!