I feel as if I’ve finished the Metric Imperial Converter so I’ve been trying to deploy it to GitHub pages so that I can submit it and get feedback before moving on to the next project.
I’ve tried following two different videos (video #1, video #2) to deploy my project to GitHub pages.
Unfortunately, in both cases I get the following error:
sh: react-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fcc-imperial-metric-converter-boilerplate@1.0.0 build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fcc-imperial-metric-converter-boilerplate@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I’ve tried to npm install react-scripts or just copy and paste text into my package.json like so:
Hi, it looks like github pages is deployed for the project already, but it’s using Readme.md as the entry point. Looking through the repo, it looks like the entry point for your app may be views/index.html? If you put a file named index.html in the root directory of your repo, Github pages will automatically use that as the entry point. But if there is no root-level index.html it will use Readme.md as a fallback I believe.
But given that your app includes a server.js express app, you’ll need to either use a different service than GH pages or refactor your app to handle all functionality in client-side javascript (because GH pages only serves static sites).
A popular free choice for working with freecodecamp is repl.it, which can host node projects online.