nodejs config.get configuration property not defined
时间: 2023-11-29 15:59:46 浏览: 28
The error message "configuration property not defined" usually means that the property you are trying to access does not exist in the configuration object.
To fix this error, you should check the spelling and case of the property name to ensure that it matches the name used in the configuration file. Also, make sure that the property is defined in the correct section of the configuration file.
Here is an example of how to use `config.get` to access a configuration property:
```javascript
const config = require('config');
const port = config.get('server.port');
```
In this example, we are using the `config` module to get the value of `server.port` from the configuration file. If `server.port` is not defined in the configuration file, you will get the error "configuration property not defined".