Skip to content

Instantly share code, notes, and snippets.

@fr20587
Last active July 13, 2022 14:09
Show Gist options
  • Select an option

  • Save fr20587/535c53ad249ce5400b524f7164eec930 to your computer and use it in GitHub Desktop.

Select an option

Save fr20587/535c53ad249ce5400b524f7164eec930 to your computer and use it in GitHub Desktop.
Esta es una breve decripcion de los pasos a seguir para desplegar aplicaciones de NestJS en Heroku

Install Heroku-cli

    npm i heroku

Add Heroku git to local remote

    heroku git:remote -a <heroku-app-name>

Config env variables

This variable is for fix problem with TS

    heroku config:set NPM_CONFIG_PRODUCTION=false  

This variable is for set production environment

    heroku config:set NODE_ENV=production

Puede agregar tantas variables como necesite sus aplicación.

VERY IMPORTANT

In NestJS app go to package-lock.json and change all fsevents dependencies required removing it and paste this

    {
        "optionalDependencies": {
            "fsevents": "~2.3.2"
        }
    }

Define Node engine version on package.json

    {
        "engines": {
            "node": "^16.x"
        }
    }

Push project and run on Heroku

    git push heroku main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment