The very first thing you should do, before jumping to too many conclusions, is to reach out to the dev and ask them about what they delivered. If they delivered a dynamic web app, that’s a big mistake on their part, but “using node.js” could mean many things. They could have given you a static site generator project, or they could have provided static files and included a simple standalone server to make it easy to view locally. Finding out what you actually have will be a necessary first step in moving forward.
I mean you’d have to ask the developer. Plenty of people use npm to, for example, install vitepress https://vitepress.dev/. So you’d have to install node packages to change things but the output is still static.
@Laine
I saw a stack overflow post that explicitly said you can’t use Node.js on GitHub pages so that’s why I concluded. Is there anything I can read to help me figure out what to do?
Lennon said: @Laine
I saw a stack overflow post that explicitly said you can’t use Node.js on GitHub pages so that’s why I concluded. Is there anything I can read to help me figure out what to do?
Stack overflow often has half-truths.
Static pages can be and often are built using node.js. npm start will run the development server, and npm build will create the static website in a subdirectory dist/. This is how a lot of the projects work.
If you don’t know how to deploy what they have created to GitHub pages, then ask.
It’s 100% true that you can’t use Node.js on GitHub pages; the fact that there’s a build step doesn’t change that fact or make it a half-truth.
The half-truth is that you can host a node.js generated page on GitHub pages, but you can’t host node.js on GitHub pages. This is a difference that might be clear to a lot of developers, but for OP, these both seem to be the same.
Lennon said: @Laine
I saw a stack overflow post that explicitly said you can’t use Node.js on GitHub pages so that’s why I concluded. Is there anything I can read to help me figure out what to do?
You can’t use any backend on GH pages, but it is fairly likely the project is only using Node to build the static site, and GH can use Node for that step.
Lennon said: @Laine
I saw a stack overflow post that explicitly said you can’t use Node.js on GitHub pages so that’s why I concluded. Is there anything I can read to help me figure out what to do?
You gotta tell us more about the project. In what way does it use node? What happens when you open index.html?
Lennon said: @Laine
I saw a stack overflow post that explicitly said you can’t use Node.js on GitHub pages so that’s why I concluded. Is there anything I can read to help me figure out what to do?
You may want to try using the free tier of Netlify for hosting. You’ll be able to connect your GitHub account and deploy from a branch (main if needs be). They will build and deploy for you. I’m happy to help you set this up, although it is super straightforward.
Lennon said: @Laine
I saw a stack overflow post that explicitly said you can’t use Node.js on GitHub pages so that’s why I concluded. Is there anything I can read to help me figure out what to do?
If you don’t know code well enough to look into the source yourself, then you will need to get help. Try looking in the package.json, run the build; it will dump out some folder with built assets. If you know how to run a webserver, then run it in that directory and test. Otherwise, simply open the index.html file and see if it works. If it does, then you don’t care about Node.js or not; it is a built static site.
Quick way would be to save the pages from the browser as they are fully rendered, then upload those files to GH pages. You may need to edit the links and asset URLs if they are absolute paths.
Bao said:
Quick way would be to save the pages from the browser as they are fully rendered, then upload those files to GH pages. You may need to edit the links and asset URLs if they are absolute paths.
This, and don’t do it manually. 20 years ago, when the internet was awfully slow and the sites were awfully bloated, there was a Teleport Pro app which did exactly what you want - crawled an entire site and saved it as a set of static pages so you could interact with it offline.
I doubt this app is still around, but sure some modern analogue is.
Bao said:
Quick way would be to save the pages from the browser as they are fully rendered, then upload those files to GH pages. You may need to edit the links and asset URLs if they are absolute paths.