Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
If you want new software use a rolling-release distro. Simple as that.
Alternatively you could do some Docker magic where you can have any package in any version in a clean environment, but if you know how to do that you don't have this problem in the first place. -
Avyy7503yUse nvm. It's becoming a bit of a trend where new langs come out with a language version manager. Haskell (hcup), rust(rustup), golang(go get <version>.. etc
Nvm is purely a bash script, so it runs almost anywhere, plus it uses a non-global self-contained installation directory for everything(Usually ~/.nvm/) -
@irene found out the repos that come with Ubuntu at least doesn't have the latest version of node. You have to install their own apt repo. Not unreasonable but OP was bitching about apt for this reason.
-
irene33923y@demortes nvm is better. It gives you a node version manager that does all the node source management for you.
I think you can apt install it? Then you can use whatever version of node you need at the moment. I use versions 10-16 for work since other teams haven’t updated.
https://github.com/nvm-sh/nvm -
@irene there's something fundamentally wrong when you need a version manager.
I need to dog into it more but I can't even run jest right now. Randomly failing test suites. Only my computer though, not other devs. Frustrating. Relates because part of it is, 8 wonder, version differences of global angular cli and supporting packages vs locally installed (even after uninstalling all global items). Node and angular just does not sit well with me right now. I'll stick with .NET. -
@demortes Yeah, I have to work on some Node projects and nowadays I only run them in containers. Much less frustrating, and easier to setup on a different machine.
And it prevents that funny bug causing npm to throw a weird error if it can't find a dependency and you have Steam installed. Such a pile of garbage. -
@stop The totally stable geniuses behind npm decided it would be a good idea that when a dependency is missing, npm should recursively search all parent directories until it either found the dependency or searched everything.
Now Steam installs an intentionally broken link for some compatibility reason. And npm can't handle that something prevents it from searching every fucking file on the computer including the hidden ones. So as a result it shits itself, throws a generic "file not found" error with a Steam-related file path and you sit there and have no fucking clue what just happened, when actually it just didn't find a dependency.
And as Docker containers usually don't have Steam installed, npm won't act like some ADHD kid and properly report the correct error. -
irene33923y@demortes @deadlyRants
Visual Studio has had “which version of dotnet do you wanna use”. People used to gripe about not being able to switch between Java version 7, 8, and 9 about a decade ago. A command line version manager isn’t symptomatic of some kind of problem, it addresses a need to switch runtimes and libraries. This is a problem for python devs that live with the old version of python bundled with MacOS. This is a huge problem for people that have to maintain old VB.Net apps. This isn’t a new development problem and certainly isn’t limited to Node.js.
Steam is probably using the global installation of node. So dependencies land in /usr/local/bin or something. If that version is broken but it will break if you change it don’t use it. Nvm manages node in ~/.nvm and uses aliases to keep it in user land. Each version of node has its own binary. Each binary has its own paired version of NPM. Nvm is very elegant in comparison to venv management on other runtimes. -
Avyy7503y@deadlyRants Do you have a package.json in your project root? I've never heard of this problem before.
-
stop68043y@deadlyRants i searrch my pc and the are a few package.json files, but the all belong to a game.
Related Rants
Here's a fucking brilliant idea:
apt-get install nodejs should download and install node latest version. This would be instead of having 18 fucking tabs open and reading through masses of stackoverflow answers for 18 months and typing thousands of instructions in the terminal and learning to fucking HATE node to install the latest version of node. Radical, I know.
rant
node