3 ms·
I've said it before and I'll say it again (and this applies to other scripting language package managers too, e.g. composer for php): while "this public package
by stephenr 3y ago
I've said it before and I'll say it again (and this applies to other scripting language package managers too, e.g. composer for php): while "this public package was unpublished" is probably something a package repo shouldn't support, the actual solution is pretty simple.
Vendor your dependencies.
By which I mean: commit the dependencies you rely on, to your VCS. It's really that simple.
Yes, this probably requires some different usage or default behaviour from package managers to be "efficient" (i.e. you probably don't need to include all the tests, docs etc for each dependency in your repo).
If you're following "best practices" for every library package manager I've seen (to commit their respective "lock" file, thereby fixing the used version of each dependency for subsequent installs), the end result is the same in terms of what version of dependency is available when the source is checked out - but now you have (a) zero risk of dependencies being pulled; (b) the ability to do comprehensive change reviews when versions are bumped; (c) likely faster updates for anyone pulling changes subsequent to a dependency change; (d) zero risk of 'install dependencies' related issues at deployment time.
- shitlord 3y agoThis only works to a point. When you install dependencies with a tool like npm install, you're installing the dependencies meant for your computer platform. You can't just copy binaries between computers and expect them to work. Even with the same OS you could be missing shared libraries.
- stephenr 3y agoCan you give an example of this phenomenon, e.g. a package that one would install using `npm` which includes binaries? I wasn't even aware this was a thing people do.
- foldr 3y agoLoads of node packages depend on native code in one form or another. E.g. https://www.npmjs.com/package/sqlite3 https://www.npmjs.com/package/sqlite3
- joshstrange 3y agoSharp and Prisma come immediately to mind. I think Less used a binary as well, or maybe it was Sass (or both)?