2 ms·
The only thing that seems clear is that post about committing the whole node_modules folder to git was correct. Despite all the ridicule HN gave it.
by Gigachad 5y ago
The only thing that seems clear is that post about committing the whole node_modules folder to git was correct. Despite all the ridicule HN gave it.
- verdverm 5y agoOr you could use a lock file
- Gigachad 5y agoLockfile doesn't help here. The packages were yanked from the repos. The lockfile will tell your package manager to try to download a package that does not exist. Checking in the entire node_modules folder saves you since you don't need to fetch any external files.
- SergeAx 5y agoGood practive here is using package cache. It is not that hard to install, and your CI builds will save tons of trafic for you and for global package repos (Github, NPM, Packagist and so on)
- verdverm 5y agoIndeed, Go would not have failed here because the global package cache keeps deleted repos. Module authors cannot effect this Other languages require you to run a cache and set proxy config up for the builders
- joshspankit 5y agoAn unfortunate solution because it might be the right one at the cost of maintainability and repo size
- thefurrysquid 5y agoYARN v2 onwards has Zero Install mode where you _do_ typically commit a cache folder to source control: https://yarnpkg.com/features/zero-installs https://yarnpkg.com/features/zero-installs It can be a little tricky to get working with some tools, but it is very fast and doesn't take up as much repo space as you'd expect since the approach is much more efficient than node_modules.