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

"invalid tar file" #1182

Closed
dangreen opened this Issue Oct 18, 2016 · 19 comments

Comments

Projects
None yet
@dangreen

dangreen commented Oct 18, 2016

Do you want to request a feature or report a bug?
bug
What is the current behavior?
package.json:

...
"lib": " https://USER:KEY@github.com/Elksimo/lib.git"
...
error https://dangreen:KEY@github.com/Elksimo/lib.git: invalid tar file
    at Extract.Parse._startEntry (/usr/local/Cellar/yarn/0.15.1/libexec/lib/node_modules/yarn/node_modules/tar/lib/parse.js:149:13)
    at Extract.Parse._process (/usr/local/Cellar/yarn/0.15.1/libexec/lib/node_modules/yarn/node_modules/tar/lib/parse.js:131:12)
    at BlockStream.<anonymous> (/usr/local/Cellar/yarn/0.15.1/libexec/lib/node_modules/yarn/node_modules/tar/lib/parse.js:47:8)
    at emitOne (events.js:96:13)
    at BlockStream.emit (events.js:188:7)
    at BlockStream._emitChunk (/usr/local/Cellar/yarn/0.15.1/libexec/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:145:10)
    at BlockStream.flush (/usr/local/Cellar/yarn/0.15.1/libexec/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:70:8)
    at BlockStream.end (/usr/local/Cellar/yarn/0.15.1/libexec/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:66:8)
    at Extract.Parse.end (/usr/local/Cellar/yarn/0.15.1/libexec/lib/node_modules/yarn/node_modules/tar/lib/parse.js:86:23)
    at UnpackStream.onend (_stream_readable.js:512:10)

If the current behavior is a bug, please provide the steps to reproduce.
yarn add https://USER:KEY@github.com/PRIVATE/REPO.git
Please mention your node.js, yarn and operating system version.

$ yarn -V
0.15.1
$ node -v                                                                                      
v6.3.0
$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.12 (16A323)
      Kernel Version: Darwin 16.0.0
@dangreen

This comment has been minimized.

dangreen commented Oct 19, 2016

In 0.16.0 this fixed

@rkurbatov

This comment has been minimized.

rkurbatov commented Nov 10, 2016

yarn 0.16.1, node v6.9.1, Linux. Having the same issue with private npm repo.

@landonpoch

This comment has been minimized.

landonpoch commented Nov 11, 2016

yarn 0.16.1, node v5.12.0, mac osx. Having the same issue with private repo also. We're using artifactory.

@rkurbatov

This comment has been minimized.

rkurbatov commented Nov 11, 2016

I had to do some cleaning and yarn/npm login/logout to fix that problem

@landonpoch

This comment has been minimized.

landonpoch commented Nov 11, 2016

I did a npm logout/login
npm cache clean
yarn cache clean

Still seeing the invalid tar file issue.

@rkurbatov Do you recall any other details that you may have had to do?

@rkurbatov

This comment has been minimized.

rkurbatov commented Nov 11, 2016

@landonpoch try to remove .npm and all .yarn* folders at your home folder and .npmrc file

@robinbullocks4rb

This comment has been minimized.

robinbullocks4rb commented Nov 12, 2016

@rkurbatov @landonpoch don't know if this helps or hinders, but I have the same problem using NPM-hosted private packages on both Heroku (not with Docker) and Docker running locally, both clean environments. For reasons I can't determine though, I don't get the problem on my local, non-Dockerised Mac OS environment.

@gijsroge

This comment has been minimized.

gijsroge commented Nov 17, 2016

Just published a package with yarn 'swiper-thumbnails' and tried to add it in a project and fails with error message 'invalid tar file'.

log: http://pastebin.com/As4hSmZx

@aspirisen

This comment has been minimized.

aspirisen commented Nov 28, 2016

Have the same

[2/4] Fetching packages...
error http://privaterepo/fsevents/-/fsevents-1.0.15.tgz: invalid tar file
warning fsevents@1.0.15: The platform "win32" is incompatible with this module.
info "fsevents@1.0.15" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error An unexpected error occurred: "ENOENT: no such file or directory, open 'C:\\Users\\***\\AppData\\Local\\Yarn\\cache\\npm-fsevents-1.0.15-fa63f590f3c2ad91275e4972a6cea545fb0aae44\\.yarn-metadata.json'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\projects\\**\\**\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
@lior-a

This comment has been minimized.

lior-a commented Dec 1, 2016

yarn 0.16.1 mac - have this issue with private npm registry (with token etc..).

the error isn't clear - is it because it can't find or doesn't have access to the package?

@LinusU

This comment has been minimized.

LinusU commented Dec 6, 2016

Same problem on Ubuntu Linux, Yarn 0.17.10

@TrustNik

This comment has been minimized.

TrustNik commented Dec 8, 2016

@lior-a

yarn 0.16.1 mac - have this issue with private npm registry (with token etc..).

I think that it is related #547

@throrin19

This comment has been minimized.

throrin19 commented Dec 14, 2016

Same problem on OSX, Yarn 0.17.10 and custom registry (private sinopia)

@oshalygin

This comment has been minimized.

oshalygin commented Dec 14, 2016

same issue as @landonpoch while using Artifactory. No issues on my local machine but fails all over the place during the travis build.

Confirmed this is only an issue when working with the private npm repo. No issues when pulling from the global registry.

@balanceiskey

This comment has been minimized.

balanceiskey commented Feb 13, 2017

I think I've cornered the issue. I was using yarn publish to publish a scoped package. Attempts to then yarn add or npm install that package would result in the cb error. I switched back to the classic npm publish and things appear to be A-OK. I don't have additional details on what might be causing issues during yarn publish but if anyone's got tips on how to debug that, happy to help out.

@oshalygin

This comment has been minimized.

oshalygin commented Feb 13, 2017

Should we re-open this issue? Why was it closed?

@deecewan

This comment has been minimized.

deecewan commented Mar 19, 2017

having this same issue. yarn publish seems to work correctly. yarn install in another location results in
error An unexpected error occurred: "https://registry.yarnpkg.com/translation-io/-/translation-io-0.0.4.tgz: invalid tar file"

I took a look inside the tarballs, extracted using the built in utility on macOS Sierra
in 0.0.4 (as above), the lib/ and src/ folders are both empty, however there is a valid-looking package.json, LICENCE and README.md.

LInks to tarballs:

The repo is public. you can take a look here. If I publish using npm publish, everything works, so you can see that there is a problem with how yarn is packaging the tarball or shipping it to NPM.

I'll also note that when using yarn publish, I used the CLI to update the package.json version, rather than when using NPM where I updated it myself.

@divyanshu013

This comment has been minimized.

divyanshu013 commented Mar 29, 2017

This could be an issue with yarn publish. I tried installing a package published by yarn but got the same error. Then I unpublished my package from npm and published it again this time using npm publish. Now it seems to be working fine.

I'm on yarn v0.21.3 on a Linux machine.

@danny-andrews

This comment has been minimized.

danny-andrews commented Apr 5, 2017

I'm still having this issue on yarn v0.20.3 with a scoped package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment