how to deploy SPA to Heroku?



  • Recently I deployed my SPA project from Github to Heroku. Everything seems right but it built failed.
    I used Express as Backend server, and I have set up the script in package.json as:

      "scripts": {
        "build": "quasar build",
        "start": "node server.js",
        "heroku-postbuild": "cd client && npm install && yarn && yarn build"
      }
    

    The build log complained that ‘sh: 1: yarn: not found’. I then changed the configs to:

      "scripts": {
        "build": "quasar build",
        "start": "node server.js",
        "heroku-postbuild": "cd client && npm install && quasar build"
      }
    

    but the build logs still complained ‘sh: 1: quasar: not found’. What do I miss? Thank you.



  • Good question. Confusing and missing information.


Log in to reply