-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
published package is corrupted if "files" is used in package.json #755
Comments
I have a similar error but it was caused by the tar file http request returning It must be passing bad data to the |
@vjpr Yes I think there might be multiple problems here - I published a public scoped module with yarn, then couldn't install because the package.json could not be found in the published package if i read the error correctly(@tkloht/[email protected], in case anyone wants to have a look at it). I couldn't reproduce this though, and I have no idea if this is related or a completely different error. |
I have started to look a little deeper into this and just wanted to share what I found so far: First of all, this happens not only with yarn publish but also with yarn pack. I have then tried to recover the corrupted archive (using this tool: http://www.urbanophile.com/arenn/coding/gzrt/gzrt.html) to see where it actually goes wrong. This is the content of the archive produced by npm pack, so this should be the correct result:
This is the content of the recovered archive produced by yarn pack:
So basically package.json is missing which seems very weird to me. |
Okay I think I have found the problem. I have a draft for a PR but it's not quite done, think it will be ready tomorrow or in the next days. |
|
* add tests for pack with files-array * include mandatory files if not in files-array npm pack includes some files even if they are not included in the “files” field in package.json. This commit creates the same behaviour in yarn pack. * explicitly exclude dotfiles in pack with files if files is used in package.json all other files should be excluded. Files with dot as first character have to be excluded explicitly because minimatch will not match them by default.
With this property, an invalid tar file is published. See yarnpkg/yarn#755
Do you want to request a feature or report a bug?
bug
What is the current behavior?
when using the "files" array to list files included in the package and publishing with yarn, the publish seems to work (there is no error message). However installing the package fails with the following error:
I have downloaded the tarball and it seems to be corrupted.
To double check I have:
If the current behavior is a bug, please provide the steps to reproduce.
Small repo where I tried this: https://github.com/t-obi/yarntest
and the corresponding npm package: https://www.npmjs.com/package/yarntest2
What is the expected behavior?
It should always work ;)
Please mention your node.js, yarn and operating system version.
node v6.2.1, yarn 0.15.1, OSX 10.12
The text was updated successfully, but these errors were encountered: