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

Error adding remote tarball package #3160

Open
blikblum opened this issue Apr 15, 2017 · 4 comments
Open

Error adding remote tarball package #3160

blikblum opened this issue Apr 15, 2017 · 4 comments

Comments

@blikblum
Copy link

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

What is the current behavior?

When adding a remote tarball package an error occurs:

error An unexpected error occurred: "https://github.com/blikblum/cherrytree/releases/download/svelte-2.4.2/build.tar.gz: EISDIR: illegal operation on a directory, open '/home/luiz/.cac
he/yarn/v1/.tmp/9417ab587e459fe380a7e913f4160254/'".

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

In an empty folder:

yarn init // create a dummy project
yarn add https://github.com/blikblum/cherrytree/releases/download/svelte-2.4.2/build.tar.gz

Manually updating dependencies in package.json like

dependencies: {
 "cherrytree": "https://github.com/blikblum/cherrytree/releases/download/svelte-2.4.2/build.tar.gz"
}

and doing yarn install the error also occurs

What is the expected behavior?
Package from link https://github.com/blikblum/cherrytree/releases/download/svelte-2.4.2/build.tar.gz
should be installed and added to dependencies

Please mention your node.js, yarn and operating system version.
Yarn 0.23.2
Node 6.10
Linux Mint 17.3 and Windows 10

@blikblum
Copy link
Author

yarn-error.log file:

Arguments: 
  /usr/bin/nodejs /usr/bin/yarn add https://github.com/blikblum/cherrytree/releases/download/svelte-2.4.2/build.tar.gz

PATH: 
  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Yarn version: 
  0.23.2

Node version: 
  6.10.2

Platform: 
  linux x64

npm manifest: 
  {
    "name": "testproj",
    "version": "1.0.0",
    "main": "index.js",
    "license": "MIT"
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile

Trace: 
  Error: https://github.com/blikblum/cherrytree/releases/download/svelte-2.4.2/build.tar.gz: EISDIR: illegal operation on a directory, open '/usr/local/share/.cache/yarn/v1/.tmp/9417ab587e459fe380a7e913f4160254/'
      at Error (native)


@victorges
Copy link

victorges commented May 11, 2017

Hey, I struggled with this error for a while when I finally managed to find the root cause, at least in my case:

For a .tar.gz to be used by yarn add it must have the file names starting with a ./. I checked your tarball and all files are listed without the leading local directory ref (tar -tf build.tar.gz).

This can be fixed simply by modifying how you refer to your files when calling tar command (i.e. passing "./*" instead of "*"). Or if you're creating it programmatically, change the file names in the headers.

@blikblum
Copy link
Author

Thanks. That worked. Leaving open since at least a note in documentation is in order

@sameer-coder
Copy link

Hey guys,
I have added a warning which informs the user of this behavior and suggests the solution.
Created PR #4898 for the same

This is my first contribution to yarn so please let me know if I have missed something. Thanks.

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

No branches or pull requests

5 participants