嘗試將我的 React 應用程式推送到 Github 時出現錯誤。首先,我在 Github 中創建了存盤庫。然后,我使用git remote add origin <repo name>. 然后我添加并提交檔案。最后我試過了git push -u origin main。我收到以下錯誤:
remote: error: File node_modules/.cache/default-development/0.pack is 153.50 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File node_modules/.cache/default-development/4.pack is 131.01 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File node_modules/.cache/default-development/2.pack is 131.43 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File node_modules/.cache/default-production/0.pack is 131.55 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File node_modules/.cache/default-development/9.pack is 131.12 MB; this exceeds GitHub's file size limit of 100.00 MB
我不明白它會如何超出限制,因為我過去創建了另外兩個具有更多代碼的 React 應用程式,并以相同的方式將它們上傳到 Github。我能想到的唯一區別是這個專案使用了 Tailwind Css 和 Firebase。我怎樣才能減小檔案的大小node_modules/.cache/default-development/9.pack甚至找到檔案是什么?
uj5u.com熱心網友回復:
無需在 git delete node_module 中推送 node_modules 然后推送它,然后只需.gitignore在同一目錄中創建一個檔案package.json并寫入
/node_modules
然后嘗試推動它然后你可以運行 npm install
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/409330.html
標籤:
