I have an error when trying to push my React app onto Github. First I created the repository in Github. Then, I added the remote repository using git remote add origin <repo name>
. Then I added and commit the files. Lastly I tried git push -u origin main
. I got the following error:
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
I do not understand how it would exceed the limit as I have created two other React apps with more code in the past and uploaded them the same way to Github. The only difference I can think of is that this project uses Tailwind Css and Firebase. How can I reduce the size of node_modules/.cache/default-development/9.pack
or even find what the file is?
CodePudding user response:
No need to push node_modules in git
delete node_module then push it and then
Just make a file .gitignore
in the same directory where package.json
and write
/node_modules
then try to push it
and then you can run npm install