Cli: npm pack, wrong pack time, always 1985.

Created on 8 Nov 2019  ·  3Comments  ·  Source: npm/cli

  Original bug ticket: [https://npm.community/t/10877](https://npm.community/t/10877)
  Originally filed: 2019-11-04T06:42:22.049Z
Bug

All 3 comments

This is not a "bug" - this is a workaround for a zip issue which is resolved by using a hardcoded date in npm.

Imo this could have been solved much better but this was the way it was solved.

See https://github.com/npm/cli/blob/3e7ed30d6e9211e39bd93ec4e254cc5a2b159947/lib/pack.js#L150 and https://github.com/npm/cli/commit/58d2aa58d5f9c4db49f57a5f33952b3106778669

Related PR: https://github.com/npm/npm/pull/20027

A suggestion for a possible "much better" solution: use the output of git show -s --format=%aI HEAD (or similar) as the argument for new Date().

Git is not always installed when npm / node is installed so this is no option ;-)

Was this page helpful?
0 / 5 - 0 ratings