fnm icon indicating copy to clipboard operation
fnm copied to clipboard

is there a way to ignore .nvmrc

Open a-b-r-o-w-n opened this issue 2 years ago • 6 comments

I have a project with a .node-version and .nvmrc with different node versions set. fnm use complains that I don't have the version found in .nvmrc installed and asks me to install.

Is there a way to disable checking of .nvmrc?

CleanShot 2022-04-15 at 08 48 00

a-b-r-o-w-n avatar Apr 15 '22 15:04 a-b-r-o-w-n

Does nvm prioritize the .node-version file over the .nvmrc file? If so, it would be nice to have the same behavior in fnm, I guess.

thasmo avatar Apr 29 '22 06:04 thasmo

I'm not sure what nvm does, and my request isn't that this is done automatically. Most projects will only have a single node version file, but in our case devs with M1 macs are using node 16 instead of node 14. I was thinking an environment variable that could set a node version file lookup path:

FNM_VERSION_FILE_PATH=".node-version:$FNM_VERSION_FILE_PATH

a-b-r-o-w-n avatar Jun 03 '22 15:06 a-b-r-o-w-n

@thasmo nvm intentionally does not support the nonstandard .node-version file at all.

ljharb avatar Jun 03 '22 16:06 ljharb

I have a project with a .node-version and .nvmrc with different node versions set

:y-tho:

Schniz avatar Sep 15 '22 01:09 Schniz

Most projects will only have a single node version file, but in our case devs with M1 macs are using node 16 instead of node 14.

on a more serious note, this feature is possible to implement and should be fairly easy to do but I think it is wrong. If your production env is Node 14, then M1 macs should use Node 14. If you want to use 16, use 16. Don’t mix them up. If you already know that the app works well on Node 16 why not upgrade it to everybody?

if the solution is allowing M1s to use Node 14 then it’s possible to implement however with the latest changes of MacOS seems like it will require to install Python 2 to do that which is a big barrier. Since EOL is next year I’m not sure that the effort is worth it

Schniz avatar Sep 15 '22 15:09 Schniz

I 100% agree. M1 Macs can use node 14 via Rosetta just fine though.

ljharb avatar Sep 15 '22 16:09 ljharb