Do you want to request a feature or report a bug?
Bug
What is the current behavior?
yarn fails to install dependencies from a private repository on Github
If the current behavior is a bug, please provide the steps to reproduce.
Create a project a new project:
$ mkdir project
$ cd project
$ npm init
Try to install a module from a private Github repository:
$ yarn add private/repo
Notice the following error:
yarn add v0.17.4
info No lockfile found.
[1/4] 🔍 Resolving packages...
error An unexpected error occurred: "TODO".
info If you think this is a bug, please open a bug report with the information provided in "/Users/josephwerle/repos/littlstar/odyssey.littlstar.com/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
What is the expected behavior?
Installation of a module from a private Github repository.
Please mention your node.js, yarn and operating system version.
node:
√ node -v
v5.12.0
yarn:
√ yarn -V
0.17.4
uname:
√ uname -a
Darwin Josephs-MacBook-Pro-2.local 16.0.0 Darwin Kernel Version 16.0.0: Mon Aug 29 17:56:20 PDT 2016; root:xnu-3789.1.32~3/RELEASE_X86_64 x86_64
OS X (10.12)
@jwerle Could you post the contents of your error log?
Since you're on node version 5.12.0, I'm curious if this is related to #1944
@olingern
Arguments:
/usr/local/bin/node /usr/local/bin/yarn add littlstar/littlstar.js
PATH:
~/bin:./bin:.:/Users/josephwerle/.rbenv/shims:/Users/josephwerle/.rbenv/bin:/usr/local/sbin:/usr/local/bin:~/bin:./bin:.:/Users/josephwerle/.rbenv/shims:/Users/josephwerle/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/bin:./bin:.:/Users/josephwerle/.rbenv/shims:/Users/josephwerle/.rbenv/bin:/usr/local/sbin:/Users/josephwerle/bin:/usr/local/Cellar/coreutils/8.25/libexec/gnubin:/usr/local/share/python:/usr/bin/vendor_perl:/Users/josephwerle/Dropbox/bin:~/repos/depot_tools:~/repos/gyp:/usr/bin/vendor_perl:/Users/josephwerle/Dropbox/bin:.:~/repos/depot_tools:~/repos/gyp:/usr/local/bin:/usr/bin/vendor_perl:/Users/josephwerle/Dropbox/bin:.:~/repos/depot_tools:~/repos/gyp:/usr/local/bin
Yarn version:
0.17.4
Node version:
5.12.0
Platform:
darwin x64
npm manifest:
{
"name": "",
"version": "1.0.5",
"description": "",
"author": "[email protected]",
"license": "Unlicense",
"dependencies": {
"choo": "^3.3.0",
"clamp": "^1.0.1",
"control-panel": "^1.2.0",
"debug": "^2.2.0",
"dom-events": "^0.1.1",
"domready": "^1.0.8",
"ionicons": "^3.0.0",
"koa": "^1.2.4",
"koa-logger": "^1.3.0",
"koa-route": "^2.4.2",
"koa-send": "^3.2.0",
"koa-static": "^2.0.0",
"ndarray-imshow": "^1.0.1",
"ndpack-image": "^2.0.0",
"raf": "^3.3.0",
"save-pixels": "^2.3.4",
"sheetify": "^5.1.1",
"universal-analytics": "^0.4.6",
"uuid": "^2.0.3"
},
"devDependencies": {
"babel-plugin-static-fs": "^1.1.0",
"babel-preset-es2015": "^6.16.0",
"babel-preset-es2020": "^1.0.2",
"babel-preset-stage-0": "^6.16.0",
"babelify": "^7.3.0",
"budo": "^9.2.1",
"rollupify": "^0.3.4",
"sheetify-cssnext": "^1.0.7",
"svg4everybody": "^2.1.0",
"uglifyify": "^3.0.4",
"yo-yoify": "^3.4.1"
},
"browserify": {
"transform": [
[
"sheetify/transform",
{
"use": [
"sheetify-cssnext"
]
}
],
"babelify"
]
}
}
yarn manifest:
No manifest
Lockfile:
No lockfile
Trace:
Error: TODO
at /usr/local/lib/node_modules/yarn/lib/resolvers/exotics/hosted-git-resolver.js:135:15
at next (native)
at step (/usr/local/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /usr/local/lib/node_modules/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
at run (/usr/local/lib/node_modules/yarn/node_modules/core-js/library/modules/es6.promise.js:87:22)
at /usr/local/lib/node_modules/yarn/node_modules/core-js/library/modules/es6.promise.js:100:28
at flush (/usr/local/lib/node_modules/yarn/node_modules/core-js/library/modules/_microtask.js:18:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
@jwerle Ah, it seems you have an invalid URL, but the error message for this wasn't updated. I have a PR open #1947 for this, but ensure what you're attempting to add is valid repo. More info.
@olingern hmm.. how should i install a private repository from github?
does yarn add https://github.com/your_private_repo give you the same error?
it gives me a different error
× yarn add https://github.com/littlstar/littlstarjs
yarn add v0.17.4
info No lockfile found.
[1/4] 🔍 Resolving packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/littlstar/littlstarjs /Users/josephwerle/Library/Caches/Yarn/.tmp/3495d41e37abc4923838d1efc3687224
Directory: /Users/josephwerle/repos/littlstar/odyssey.littlstar.com
Output:
Cloning into '/Users/josephwerle/Library/Caches/Yarn/.tmp/3495d41e37abc4923838d1efc3687224'...
remote: Repository not found.
fatal: repository 'https://github.com/littlstar/littlstarjs/' not found
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
It looks like this is an authentication issue. Are you able to git clone https://github.com/littlstar/littlstarjs with no problems?
@olingern ah, shit sorry i had a typo! it is working
@olingern so it is safe to assume that installation of private repositories on github should be explicit?
@jwerle If by explicit you mean a fully qualified github url, then - yes. Yarn wouldn't know how to resolve yarn add myPrivateProjectName without a url.
Maybe, I'm missing what you're asking though
@olingern in the context of a npm user transitioning to yarn I was used to npm install org/repo --save adding the "package": "github:org/repo" entry to my dependencies in my package.json file. I was also used to running npm install and the install process honoring those entries
Most helpful comment
@olingern in the context of a
npmuser transitioning toyarnI was used tonpm install org/repo --saveadding the"package": "github:org/repo"entry to my dependencies in mypackage.jsonfile. I was also used to runningnpm installand the install process honoring those entries