Do you want to request a feature or report a bug?
🐞
What is the current behavior?
yarn install causes an error after manually updating package.json to a new tag of a dependency:
$ yarn install
yarn install v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
error Couldn't find a package.json file in {"hostname":"github.com","protocol":"ssh:","repository":"ssh://git@github.com/my-company/my-project"}
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The same repo with latest Yarn master code produces a different output:
$: ~/Projects/yarn/bin/yarn install
yarn install v1.0.0
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
[3/5] 🚚 Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: archive ba95cc498558d17347a3ced52db22a9820b8e7a8
Directory: /Users/jvalore/Library/Caches/Yarn/v1/.tmp/636b08979e2a5e150506b13737ceb50b
Output:
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
If the current behavior is a bug, please provide the steps to reproduce.
I have a devDependency on a private github repo that references a tag:
"devDependencies": {
"my-project": "git+ssh://git@github.com/my-company/my-project#v1.1.0",
I pushed a new commit and tag to the project, so manually updated my package.json to
"devDependencies": {
"my-project": "git+ssh://git@github.com/my-company/my-project#v1.2.0",
then ran yarn install which causes the above errors.
Workaround
yarn cache clean && yarn install
fixes the issue and installs everything correctly, so I suspect the cached previous version of the package must be messing things up.
What is the expected behavior?
Install the my-project dependency at the commit associated with the tag.
Please mention your node.js, yarn and operating system version.
Node 8.3.0
Yarn 0.27.5 (and master branch)
OSX Sierra