zkat / cacache

💩💵 but for your data. If you've got the hash, we've got the cache ™ (moved)

Home Page:https://github.com/npm/cacache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest version on NPM has old timestamps

Josniii opened this issue · comments

Installing the latest version through NPM results in the following files having very old timestamps:

find ./node_modules/* -mtime +10950
./node_modules/cacache/README.md
./node_modules/cacache/verify.js
./node_modules/cacache/CHANGELOG.md
./node_modules/cacache/README.es.md
./node_modules/cacache/locales/en.json
./node_modules/cacache/locales/es.json
./node_modules/cacache/locales/en.js
./node_modules/cacache/locales/es.js
./node_modules/cacache/en.js
./node_modules/cacache/rm.js
./node_modules/cacache/ls.js
./node_modules/cacache/index.js
./node_modules/cacache/es.js
./node_modules/cacache/lib/verify.js
./node_modules/cacache/lib/util/tmp.js
./node_modules/cacache/lib/util/y.js
./node_modules/cacache/lib/util/hash-to-segments.js
./node_modules/cacache/lib/util/fix-owner.js
./node_modules/cacache/lib/util/move-file.js
./node_modules/cacache/lib/memoization.js
./node_modules/cacache/lib/content/path.js
./node_modules/cacache/lib/content/rm.js
./node_modules/cacache/lib/content/write.js
./node_modules/cacache/lib/content/read.js
./node_modules/cacache/lib/entry-index.js
./node_modules/cacache/LICENSE.md
./node_modules/cacache/get.js
./node_modules/cacache/put.js

These cause issues with deployments to Elastic Beanstalk:
ERROR: ValueError :: ZIP does not support timestamps before 1980

I manually fixed these for now with find ./node_modules/* -mtime +10950 -exec touch {} + so I could get on with things, but I'd like to see this fixed as its a major nuisance when using EB.

Node version: 6.11.5
NPM version: 3.10.10

Is this gonna be fixed ?

Oh yikes! What version of zip is this?!

It's happening for me when the AWS Elasticbeanstalk CLI tries to build a deployable.

Honestly you should probably use a ZIP implementation that doesn't implode on old timestamps. This is a new feature of npm that allows us to generate tarballs with identical checksums across machines, and there's no way to change previously-published packages that suffer from this (cacache being one of them).

Additionally, I really don't consider this a bug in cacache: if you want a quick fix, I suggest you make your deploy script manually fix those time stamps, as OP shared, and just wait until the npm CLI takes action on this. You'll continue to see this error for the foreseeable future as users use versions of the CLI that don't have that hypothetical patch, though.

Since this is not a cacache bug, I'm closing this.

Oh, and if you want somewhere to put this bug up: I suggest putting it in https://github.com/npm/node-tar/issues which is where this would be actionable.

Have you considered using the date of the last commit for all your timestamps? Using unix 0 as a last modified date is going to have far reaching repercussions down the line.

Also, a few days ago it looks like 10.0.2 didn't have this problem. Did you re-release it by chance? I was under the impression npm's were immutable.

@hawknewton the tarballs are indeed immutable. If you didn't notice there being a problem before, then you probably just didn't notice or something changed on your end.