Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js v23 - NPM publish fails due to "tarball data for file ... seems to be corrupted" #55488

Closed
jay-n-h opened this issue Oct 22, 2024 · 1 comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@jay-n-h
Copy link

jay-n-h commented Oct 22, 2024

Version

23.0.0

Platform

Linux 6.10.12-hardened1-1-hardened #1 SMP PREEMPT_DYNAMIC Wed, 02 Oct 2024 17:47:30 +0000 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Install Node.js v23.0.0 & attempt to pack an NPM package.

How often does it reproduce? Is there a required condition?

No required condition. Always reproducible.

What is the expected behavior? Why is that the expected behavior?

The NPM package should pack successfully.

What do you see instead?

NPM warns about tarball data in the repository directory being null/corrupted, then errors as it cannot find the file to pack.

It seems to be missing the first character of the dist path? I'm not even sure how it knows the .tsbuildinfo file exists when it's apparently looking in the ist instead of dist directory.

npm warn tarball tarball data for file:/home/work/Repositories/example/ (null) seems to be corrupted. Trying again.
npm warn tarball tarball data for file:/home/work/Repositories/example/ (null) seems to be corrupted. Trying again.
npm error code ENOENT
npm error syscall lstat
npm error path /home/work/Repositories/example/ist/.tsbuildinfo
npm error errno -2
npm error enoent ENOENT: no such file or directory, lstat '/home/work/Repositories/example/ist/.tsbuildinfo'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /home/work/.npm/_logs/2024-10-22T09_39_37_630Z-debug-0.log

My files property in package.json:

"files": [
    "dist",
    "package.json",
    "bun.lockb",
    "README.md"
],

Additional information

Downgrading to Node.js v22.10.0 fixes the issue. NPM now successfully packs the package using the dist directory instead of ist:

npm notice 📦  [email protected]
npm notice Tarball Contents
npm notice 135B README.md
npm notice 282.8kB bun.lockb
npm notice 142.9kB dist/.tsbuildinfo
npm notice 2.9MB dist/bin/cli.js
npm notice 6.0MB dist/bin/cli.js.map
npm notice 21.4kB dist/bun.d.ts
npm notice 1.5MB dist/bun.js
npm notice 3.7MB dist/bun.js.map
npm notice 6.1kB package.json
npm notice Tarball Details
npm notice name: example
npm notice version: 0.1.0
npm notice filename: example-0.1.0.tgz
npm notice package size: 3.7 MB
npm notice unpacked size: 14.7 MB
npm notice shasum: ef33d77cc204d62e26e1773ebaad0c99e65cc537
npm notice integrity: sha512-Bl5xasx8pOzXg[...]iFlr/qT3nWjKA==
npm notice total files: 9
npm notice
example-0.1.0.tgz
@aladdin-add
Copy link

Duplicate of #55410

@avivkeller avivkeller closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
@avivkeller avivkeller added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

3 participants