0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

yarn installでrefs/heads/xxxブランチがないって言われた時の対処法

Posted at

なぜか急にyarn installyarn addができなくなった。
yarn cache clearでcacheクリアしたらできるようになった。

yarn install/addができない

$ yarn install
yarn install v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: /Users/xxx/Library/Caches/Yarn/v6/.tmp/e435b7ca0cb96f2553222bc619c5b701
Output:
Your configuration specifies to merge with the ref 'refs/heads/ng-new'
from the remote, but no such ref was fetched.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
$ yarn add bootstrap-icons
yarn add v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: /Users/xxx/Library/Caches/Yarn/v6/.tmp/e435b7ca0cb96f2553222bc619c5b701
Output:
Your configuration specifies to merge with the ref 'refs/heads/ng-new'
from the remote, but no such ref was fetched.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

remoteブランチを確認してみると確かにない

$ git ls-remote origin | grep ng-new
# なし

cacheクリアしてみる

$ yarn cache clean
yarn cache v1.22.10
success Cleared cache.
✨  Done in 30.85s.

yarn installできたー:tada:!!!

$ yarn install
yarn install v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
✨  Done in 35.10s.
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?