简体   繁体   中英

Heroku deployment error: Cannot find module '../models/User'

Heroku Logs

2021-07-21T11:36:31.433312+00:00 heroku[web.1]: Starting process with command `node app.js`
2021-07-21T11:36:35.175691+00:00 heroku[web.1]: Process exited with status 1
2021-07-21T11:36:35.256063+00:00 heroku[web.1]: State changed from starting to crashed
2021-07-21T11:36:35.109475+00:00 app[web.1]: internal/modules/cjs/loader.js:969
2021-07-21T11:36:35.109505+00:00 app[web.1]: throw err;
2021-07-21T11:36:35.109506+00:00 app[web.1]: ^
2021-07-21T11:36:35.109506+00:00 app[web.1]:
2021-07-21T11:36:35.109506+00:00 app[web.1]: Error: Cannot find module '../models/User'
2021-07-21T11:36:35.109507+00:00 app[web.1]: Require stack:
2021-07-21T11:36:35.109507+00:00 app[web.1]: - /app/config/passport-config.js
2021-07-21T11:36:35.109508+00:00 app[web.1]: - /app/app.js

My app directory

在此处输入图像描述

I have also set.env variable在此处输入图像描述

Can any body help me!! It will very helpfull for me

I've read some answers saying heroku is case sensetive. If so, heroku is expecting models/User and getting models/user in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM