Gitでクローン時に「Clone succeeded, but checkout failed」が出る時の対処法
こんにちは!丼です。
最近、社用PCをWin7からWin10に切り替えました。
タイトルの件、環境構築していたらハマったのでメモしておきます。
fatal: cannot create directory at 'node_modules/gulp-connect/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids': Filename too long warning: Clone succeeded, but checkout failed. You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD'
Win10でGitのクローンを実行したら怒られました。node_modulesの中のパスが深く、パスの文字数が260文字を超えたために起こる現象ですね。
「そもそもnode_modulesはignoreしようよ」という指摘はごもっともですが、まぁ、色々事情があるんです..笑