paulodiovani / hacktoberrank

Hacktoberfest Rank
https://hacktoberrank-challenge.herokuapp.com/
MIT License
6 stars 17 forks source link

Error: Cannot find module 'dotenv' #45

Closed paulodiovani closed 4 years ago

paulodiovani commented 4 years ago

Problem description

Heroku install nod modules with --only=prod option, so it won't install devDependencies. Since our dotenv is required at index.js, the server fail to load.

Error: Cannot find module 'dotenv'

Proposed solution

One of the options bellow:

  1. Move dotenv to dependencies or
  2. add a try {} catch block around it on backend/index.js