-
-
Notifications
You must be signed in to change notification settings - Fork 958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't Deploy Github Pages with All node_modules #76
Comments
@jkaw were you able to fix it? If yes, can you upload the package.json |
@sachinjogi the package json is correct. You just need to delete all folders in the node_modules folder except for the ones I listed from your fork. In your local you might want to keep the gulp related ones if you plan on changing any js/css as those will need to be minimized. |
Right, actually it wasn't the issue with the package.json, author had pushed node modules to the repo which had some erroneous files. I jusr reverted it to an older commit and it fixed it. |
@sachinjogi I recently updated older dependency versions to their latest ones. This shouldn't give you any issues. Make sure you run: |
@rampatra can you remove the extra node folders from your master? It will prevent this from being able to deploy on pages otherwise. You can change the README to run the npm commands. Even your github pages deploy action failed with the latest commit. |
@jkaw it's deleted now. Users have to do |
@rampatra if you delete the entire folder, you will lose a few node js libraries that the site needs to function properly. Check wedding.rampatra.com to see whats broken on your demo now. You need to keep the three folders I mentioned. |
@jkaw I do not understand. Why doesn't it work on github pages? Locally, this works fine. |
I tried even defining my own custom workflow file with build commands but still no luck. Here is the workflow file for reference: https://github.com/rampatra/wedding-website/actions/runs/4298555939/workflow |
The problem is that the node_modules folder has too many unnecessary folders. The only ones you need for the website to function properly are: The rest of them are not needed for the website to run. The extras that were in the node_modules folder caused the deployment tar to exceed the size limit for github pages. I will submit a merge request to restore things and you can take a look. |
check pull request #77. In my personal fork I did this and my github pages works. |
It is now fixed. I have gone with another approach (I think it's a bit cleaner than including node_modules folder). You can check out the latest index.html file. Also, after seeing my recent changes carefully, I think my custom workflow (https://github.com/rampatra/wedding-website/actions/runs/4298555939/workflow) isn't complete. It did build fine but wasn't deploying the latest changes from master branch. If anyone has time to look into this new workflow thing then node_modules should work fine even on github pages. There won't be any issues because of the large size. So, to conclude, as I couldn't find time to fix the workflow approach, I added a fallback mechanism in index.html, and therefore github pages now work fine. |
I updated my workflow file with deploy instructions but I am seeing other issues now - https://github.com/rampatra/wedding-website/blob/master/.github/workflows/npm-gulp.yml I will have to debug it later. But for now, the fallback technique in index.html is fine to make the website work on github pages. |
I have closed this issue as the website works fine on Gihub Pages and created a new ticket to fix Workflow - #78 |
Github pages will fail if you try to deploy with all of the node modules currently in your repo.
Remove all but the necessary ones in the package.json
"animate.css": "^3.7.2",
"font-awesome": "^4.7.0",
"waypoints": "^4.0.1"
and the gulp related ones for development. But you probably should put some gulp info in the README as well so people know how to minimize/compile the js and sass files.
The text was updated successfully, but these errors were encountered: