Moving from glitch to netlify

Site name: https://cover-hack.netlify.app

So I’m trying to move from glitch to netlify since I’ve been having a better experience with it. The glitch app is here:

Now I just may be completely in the wrong, and netlify doesn’t support what I’m trying to do, so sorry if that’s the case. In Glitch I can simply go to the terminal and run, in sequence:

npm install
cd client
npm install
npm run build

But when I plug in npm run build in the build command (which is defined in package.json), it outputs the error log at the bottom. Any suggestions on the issue? The deployment is linked to this github repository: https://github.com/novatorem/Cover-Hack

The log of the failure is here:

8:33:52 PM: ┌────────────────────────────────┐

8:33:52 PM: │ 1. Build command from settings │

8:33:52 PM: └────────────────────────────────┘

8:33:52 PM: ​

8:33:52 PM: $ npm run build

8:33:52 PM: npm

8:33:52 PM: ERR!

8:33:52 PM: missing script: build

8:33:52 PM: npm

8:33:52 PM: ERR! A complete log of this run can be found in:

8:33:52 PM: npm ERR!

8:33:52 PM: /opt/buildhome/.npm/_logs/2020-06-10T00_33_52_472Z-debug.log

8:33:52 PM: ​

8:33:52 PM: ┌─────────────────────────────┐

8:33:52 PM: │ "build.command" failed │

8:33:52 PM: └─────────────────────────────┘

Hey @novatorem,
Welcome to the forum! The short answer to this is: “npm run build” is not a command in your package.json file. It looks like your command is “npm run build-run”:

The longer answer is: that still won’t work because you’re app relies on a server. Glitch is an awesome platform, but works pretty differently than ours does. One significant difference is that we build, deploy, and host Jamstack sites—Javascript, APIs, and markdown. The idea is that we generate all the assets you need for your site and then host them on CDN nodes around the world so your sites are really fast for anyone who accesses them, wherever they’re visiting from. There’s no server side code at runtime in this architecture. Here’s a longer explanation on that:

So! Taking a quick look at your repo, it looks like you do have a server. To host on Netlify, you’d have to port your app to be serverless and set up a different database configuration to work with that. This blog post might be useful for you:

Let us know if we can answer any other questions about any of this!

1 Like