“invalid tar file”

Do you want to request a feature or report a bug?

bug

What is the current behavior?

Install fails with this stack trace:

Trace: 
  Error: https://registry.yarnpkg.com/eslint-plugin-getsentry/-/eslint-plugin-getsentry-2.0.0.tgz: invalid tar file
      at Extract.Parse._startEntry (/usr/lib/node_modules/yarn/node_modules/tar/lib/parse.js:149:13)
      at Extract.Parse._process (/usr/lib/node_modules/yarn/node_modules/tar/lib/parse.js:131:12)
      at BlockStream.<anonymous> (/usr/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/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:145:10)
      at BlockStream.flush (/usr/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:70:8)
      at BlockStream.end (/usr/lib/node_modules/yarn/node_modules/block-stream/block-stream.js:66:8)
      at Extract.Parse.end (/usr/lib/node_modules/yarn/node_modules/tar/lib/parse.js:86:23)
      at UnpackStream.onend (_stream_readable.js:511:10)

If the current behavior is a bug, please provide the steps to reproduce.

Installing dependencies using this command: yarn

Please mention your node.js, yarn and operating system version.

Node: 6.9.1
Yarn: 0.16.1
Dockerfile: https://github.com/sdelements/gitlab-ci-runner/blob/master/Dockerfile

Author: Fantashit

5 thoughts on ““invalid tar file”

  1. This line looks broken:

    const registry = addSuffix(this.getRegistry(pathname), ‘/’);

    .

    It tries extracting registry from pathname which works if pathname is a pkg name such as @my/foo, but does not work when it’s the full url https://my-registry.com/@my/foo/download/@my/foo-1.7.0.tgz.

    This means the auth token is not used when downloading the tarball. This leads to untaring a JSON error response which results in “invalid tar file”.

  2. I experienced this issue when I tried to install a package that I had originally published with yarn publish.

    I then bumped the version and republished the package with npm publish. I was then able to yard add the package without issue.

  3. Is this an issue with yarn publish then? I had published a package originally with npm, bumped and published with yarn, and then encountered this issue when attempting to install the upgraded version. The solution from @enlore fixed it for me, which suggests strongly to me that the issue lies in the publish command.

Comments are closed.

“invalid tar file”

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

Author: Fantashit

3 thoughts on ““invalid tar file”

  1. 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.

Comments are closed.