这个是因为什么 是config.js的配置问题还是node的问题

img

这个是因为什么 是config.js的配置问题还是node的问题

依赖包删了,重新安装试试

  • 这篇博客: Nodejs网站建设常用库收集中的 全局信息配置 config 部分也许能够解决你的问题, 你可以仔细阅读以下内容或跳转源博客中阅读:
  • //引入配置模块
    const config = require('config');
    // 建立config文件夹下辖
    custom-environment-variables.json
    {
        "db":{
            "pwd":"APP_PWD"//这个在系统环境添加值
        }
    }
    default.json
    development.json
    production.json
    
    
    其他文件引入 使用${config.get('db.user')}获得