Yarn: Cannot add or install package from private Github repo

Created on 13 Dec 2018  ยท  4Comments  ยท  Source: yarnpkg/yarn

Bug report

What is the current behavior?

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

Either yarn add "[email protected]/refinio/one.git" or yarn install when that private repo URL already is in package.json

What is the expected behavior?

Add or install the package from the private repo (npm works).

What I get is yarn (but not npm!) being confused by https://www.npmjs.com/package/one, a package with the same name in the npm repository.

What I get, example for yarn add:

mha@mint-virtual-machine ~/neo $ yarn add "[email protected]/refinio/one.git"
yarn add v1.12.3
info No lockfile found.
[1/4] Resolving packages...
Couldn't find any versions for "one" that matches "[email protected]/refinio/one.git"
? Please choose a version of "one" from this list: (Use arrow keys)
โฏ 6.0.1 
  6.0.0 
  5.1.4 
  5.1.3 
  5.1.2 
 ....(list of many versions)

Those versions are from the package in the npm repository, not from the Github URL!

I expect yarn to use the given Github URL (works with npm).

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

Linux Mint, node 11.4.0, yarn 1.12.3


Full contents of package.json:

{
  "name": "one.neo",
  "version": "0.2.0",
  "private": true,
  "author": "[email protected]>",
  "license": "SEE LICENSE IN LICENSE.md",
  "scripts": {
    "build": "./build.js"
  },
  "dependencies": {
    "one": "[email protected]/refinio/one.git",
    "utf-8-validate": "^*"
  },
  "devDependencies": {
    "@babel/core": "*",
    "@babel/plugin-transform-runtime": "*",
    "@babel/preset-env": "*",
    "@babel/preset-flow": "*",
    "@babel/register": "*",
    "@babel/runtime": "*",
    "babel-eslint": "*",
    "babel-loader": "*",
    "babel-preset-minify": "*",
    "chai": "*",
    "dependency-tree": "*",
    "eslint": "*",
    "eslint-plugin-flowtype": "*",
    "flow-bin": "*",
    "jsdoc": "*",
    "jsdoc-babel": "*",
    "jsdoc-strip-async-await": "*",
    "mocha": "*",
    "rollup": "*",
    "rollup-plugin-babel": "*",
    "rollup-plugin-commonjs": "*",
    "rollup-plugin-flow": "*",
    "rollup-plugin-node-resolve": "*",
    "sinon": "*",
    "webpack": "*",
    "webpack-cli": "*",
    "webpack-emit-all-plugin": "*"
  },
  "optionalDependencies": {
    "bufferutil": "*"
  }
}
triaged

Most helpful comment

Anyone?

All 4 comments

Anyone?

Same

Have the same issue with 1.16.0

same problem

Was this page helpful?
0 / 5 - 0 ratings