Repository navigation
Commit b7beb69
committed
fix(bundle): tar --hard-dereference in bundle archive (npm E415)
npm's per-tarball publish endpoint returns HTTP 415 'Unsupported Media Type - Hard link is not allowed' when the tarball contains hard links. \pnpm install --prod --config.node-linker=hoisted\ (added in commit bb58f8d to fix issue #28) leaves hard links inside \
ode_modules/\ — those are fine on disk but \ ar -czf\ preserves them as hard links in the archive, which npm rejects.
\ ar --hard-dereference\ dereferences every hard link to a copy of the underlying inode before writing the archive, producing a flat tree of regular files. Cost: a few MB of disk on the bundle (most hard links in node_modules are small files), negligible against the time saved by not re-architecting pnpm's hardlink strategy.
Verified locally: \ ar --no-xattrs --hard-dereference -czf /tmp/test.tar.gz -C /tmp/extract codegraph-vba-linux-x64\ produces a tarball with 0 hard links, vs. the previous 1,847.1 parent 2f3e969 commit b7beb69
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
0 commit comments