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

yarn fails to install packages with github tarball dependencies #3243

Open
bertramn opened this issue Apr 24, 2017 · 3 comments
Open

yarn fails to install packages with github tarball dependencies #3243

bertramn opened this issue Apr 24, 2017 · 3 comments

Comments

@bertramn
Copy link

Bug

What is the current behavior?

I checked in a patched node package which has a patched dependency node package. The dependency tree look like this:

myproject:
  dependencies:
    keycloak-connect: https://github.com/bertramn/keycloak-nodejs-connect/tarball/3.0.x"
      dependencies:
        keycloak-auth-utils: https://github.com/bertramn/keycloak-nodejs-auth-utils/tarball/3.0.x"

Why I would do such thing you might ask? Well ... there is no way in yarn to force version/location override of dependencies of a dependency. I tried a lot of things including the dependencies override in the package.json file without any luck. Something like that can easily be done in npm shrinwrap, just drop in a npm-shirnwrap.json file and we are good to go:

{
  "dependencies": {
    "keycloak-connect": {
      "version": "3.0.0",
      "from": "keycloak-connect@3.0.0",
      "dependencies": {
        "keycloak-auth-utils": {
          "version": "3.0.0",
          "from": "https://github.com/bertramn/keycloak-nodejs-auth-utils/tarball/3.0.x"
        }
      }
    }
  }
}

So in absense of some simmilar capability in yarn, this is the dirty hack that should work.

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

Yarn fails with the below error message, despite there being a package.json in the dependency package and the dependency of the dependency package.

error Couldn't find a package.json file in "C:\\Users\\fred\\workspaces\\yarn-fail\\node_modules\\keycloak-connect\\node_modules\\keycloak-auth-utils"

Example package.json to demonstrate error:

{
  "name": "yarn-fail",
  "version": "1.0.0",
  "description": "Example package from github tarball with a nested dependency from github tarball",
  "author": "Niels Bertram <nielsbne@gmail.com>",
  "license": "Apache-2.0",
  "dependencies": {
    "keycloak-connect": "https://github.com/bertramn/keycloak-nodejs-connect/tarball/3.0.x"
  }
}

Running this simple example will result in following error:

C:\Users\fred\workspaces\yarn-fail>yarn install
yarn install v0.22.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
error Couldn't find a package.json file in "C:\\Users\\fred\\workspaces\\yarn-fail\\node_modules\\keycloak-connect\\node_modules\\keycloak-auth-utils"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

What is the expected behavior?

Yarn installs the package and its dependencies as per package.json declaration.

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

windows 7 x64
node v6.10.1
yarn 0.22.0

@blikblum
Copy link

Similar to #3160

@blikblum
Copy link

@bertramn you may want look at the workaround pointed at #3160

@bertramn
Copy link
Author

@blikblum unfortunately the workaround does not work in my case. I am using the standard GitHub source download API to pull down the package. Changing the way the sources are zipped is solely controlled by that API.

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

4 participants