error: Cannot read property of undefined

前端 未结 1 388
没有蜡笔的小新
没有蜡笔的小新 2021-01-26 17:35

I\'m trying to configure my app using Express like the following way, but I\'m getting errors on doing that:

server.js

var express = require(\'express\')         


        
相关标签:
1条回答
  • 2021-01-26 17:49

    Assuming you aren't setting process.env.NODE_ENV and it's using the default value, then your problem here is a simple spelling mistake

    process.env.NODE_ENV || 'devleopment';
    

    should be

    process.env.NODE_ENV || 'development';
    

    Your config file doesn't export an object devleopment hence why it returns undefined.

    0 讨论(0)
提交回复
热议问题