News for hackers. Stuff that matters.
Re:What NPM should do to stop a new colors attack by MattPalmer1086 on Tuesday January 11, 2022 @03:25AM (#29888971)
I guess my experience is limited. For example, maven dependencies usually specify the exact version required in the pom files. At least, on all the projects I've ever dealt with.
Re:What NPM should do to stop a new colors attack by acdha on Tuesday January 11, 2022 @07:45AM (#29890851)
I’ve seen plenty of pom.xml files which are unversioned — not having a standard command to update means less disciplined developers say it’s too much work – but increasingly in other languages (and Gradle IIRC) there’s a distinction between the metadata file listing your direct dependencies and a lock file detailing exactly what was installed. The idea is that (using Node as an example) I’d say “I depend on the AWS SDK” in the main file, which changes infrequently when I add or remove direct dependencies, but my tool would use the lock file (npm-shrinkwrap) to record the exact versions of every package, preferably even by file hash, so you can have a highly repeatable build.

Separating the two is handy both due to frequent churn and to avoid transitive dependencies being kept unnecessarily — I’ve seen projects where libfoo stopped depending on libbar a while back but they were still installing it because someone had copy-pasted that block years before and was just incrementing the version.

Re:What NPM should do to stop a new colors attack by MattPalmer1086 on Wednesday January 12, 2022 @03:40PM (#29912384)
Thanks for the explanation, makes a lot of sense :)
Re:What NPM should do to stop a new colors attack by acdha on Wednesday January 12, 2022 @04:04PM (#29912653)
You’re welcome!