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?

備忘録 next.js

Posted at

諸注意 

これは自分用の備忘録です。
参考にはならないかもです。

環境

node v21.7.3
yarn 4.3.0
windows 11

next.jsを導入

nodo.js・git・vscodeをダウンロード

その後、vs codeで、コマンドラインを開き、以下を入力

yarn create-next-app

その後、git hubを開き、新しくリモートリポジトリーを作成し、pushするだけ…

で終わりだと思っていました…

躓き yarn が重すぎてpushできない問題

リモートリポジトリーにプッシュしてみますが、以下のようなエラーが出現。
スクリーンショット 2024-06-17 200037.png

?????

このgitのリモートリポジトリーは空っぽですが?!

コマンド出力を確認してみると以下のようなエラーが…

~省略~
remote: error: File .yarn/unplugged/@next-swc-win32-x64-msvc-npm-14.2.4-619f8a900f/node_modules/@next/swc-win32-x64-msvc/next-swc.win32-x64-msvc.node is 129.50 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
~省略~

こんな感じのエラーが出現

chatgpt君に訪ねてみると、100M以上のファイルはpushできないよとのこと

解決方法を聞くと、git lsfとやらをインストールせよらしい。

しかしコミット後だったため、ファイルを削除してやり直す。

npx create-next-app

でyarnじゃない next.jsのappを作成。そのままpush!

lsfとやらをインストールし、重そうな原因のファイルをトレース

git lfs install
git lfs track "*.node"
git lfs track "*.py"

ここで先に変更された.gitattributesをpush!
じゃないと、トレースしてくれなくて、同じエラーが吐かれる(N敗)

yarn

でyanr環境にして、新しく追加された、yarn関係のファイルをpush!

これでyanr環境を実装できる。

感想

前まで普通に、pushできてたと思うんだけど何でこんな面倒な方法を踏まないといけないのか分からないといけなくなっちゃったの?

もっといい方法があったもしくはあれば、この記事のコメントとかで教えていただけると幸いです。

0
0
2

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?