top | item 45752769

(no title)

roflyear | 4 months ago

what happens when you have two projects using different versions of node, etc? isn't that a massive headache?

not that it's great to start with, but it does happen, no?

discuss

order

cluckindan|4 months ago

You create a .node-version file and use fnm or nvm, and presto, when you cd into a project dir, the corresponding node version is activated.

Installing a particular node version also becomes as easy as

    fnm install 24

oblio|4 months ago

The rest of the world handles that through PATH/PATH equivalent.

Either the package manager is invoked with a different PATH (one that contains the desired Node/Java/whatever version as a higher priority item than any other version on the system).

Or the package manager itself has some way to figure that out through its config file.

Or there is a package manager launch tool, just like pyenv or whatever, which does that for you.

In practice it's not that a big of a deal, even for Maven, a tool created 21 years ago. As the average software dev you figure that stuff out a few weeks into using the tool, maybe you get burnt a few times early on for misconfiguring it and then you're on autopilot for the rest of your career.

Wait till you hear about Java's CLASSPATH and the idea of having a SINGLE, UNIFIED package dependency repo on your system, with no need for per-project dependency repos (node_modules), symlinks, or all of that stupidity.

CLASSPATH was introduced by Java in 1996, I think, and popularized for Java dependency management in 2004.

dragonwriter|4 months ago

> The rest of the world handles that through PATH/PATH equivalent.

Activating a venv is just setting a few environment variables, including PATH, and storing the old values so that you can put them back to deactivate the environment.

1718627440|4 months ago

Well, that is how Python does it as well, an venv is a script setting the PYTHONPATH.