joy460154849 2017-09-18 06:57 采纳率: 0%
浏览 3308

[egg-mongoose] url is required on config

错误:
2017-09-18 14:35:11,901 INFO 1320 [master] egg version 1.8.0

assert.js:81
throw new assert.AssertionError({
^
AssertionError: [egg-mongoose] url is required on config
at module.exports.app (/Users/lixiuming/egg-example/node_modules/egg-mongoose/lib/mongoose.js:11:3)
at module.exports.agent (/Users/lixiuming/egg-example/node_modules/egg-mongoose/agent.js:4:28)
at AgentWorkerLoader.loadFile (/Users/lixiuming/egg-example/node_modules/egg-core/lib/loader/egg_loader.js:268:30)
at getLoadUnits.forEach.unit (/Users/lixiuming/egg-example/node_modules/egg-core/lib/loader/mixin/custom.js:33:29)
at Array.forEach (native)
at AgentWorkerLoader.loadCustomAgent (/Users/lixiuming/egg-example/node_modules/egg-core/lib/loader/mixin/custom.js:33:8)
at AgentWorkerLoader.load (/Users/lixiuming/egg-example/node_modules/egg/lib/loader/agent_worker_loader.js:21:10)
at new Agent (/Users/lixiuming/egg-example/node_modules/egg/lib/agent.js:25:17)
at Object. (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/agent_worker.js:22:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
2017-09-18 14:35:13,358 ERROR 1320 nodejs.AgentWorkerDiedError: [master] agent_worker#1:1321 died (code: 1, signal: null)
at Master.onAgentExit (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/master.js:289:17)
at emitOne (events.js:96:13)
at Master.emit (events.js:188:7)
at Messenger.sendToMaster (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/utils/messenger.js:122:17)
at Messenger.send (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/utils/messenger.js:87:12)
at ChildProcess.agentWorker.once (/Users/lixiuming/egg-example/node_modules/egg-cluster/lib/master.js:189:22)
at ChildProcess.g (events.js:292:16)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
name: 'AgentWorkerDiedError'
pid: 1320
hostname: lixiumingdeMacBook-Air.local

2017-09-18 14:35:13,359 ERROR 1320 [master] agent_worker#1:1321 start fail, exiting with code:1
2017-09-18 14:35:13,359 ERROR 1320 [master] exit with code:1
⚠️ Error: /Users/lixiuming/egg-example/node_modules/egg-bin/lib/start-cluster {"baseDir":"/Users/lixiuming/egg-example","framework":"/Users/lixiuming/egg-example/node_modules/egg","workers":1} exit with code 1
⚠️ Command Error, enable DEBUG=common-bin for detail

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! example@1.0.0 dev: egg-bin dev
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the example@1.0.0 dev script 'egg-bin dev'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! egg-bin dev
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs example
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls example
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/lixiuming/egg-example/npm-debug.log

配置:
// {app_root}/config/plugin.js
exports.mongoose = {
enable: true,
package: 'egg-mongoose',
};

// /config/config.default.js
exports.mongoose = {
url: 'mongodb://@139.196.53.86:50000/otron',
options: {
user : "dba",
pass : "jEjU7!v6Dx",
auth : {authMechanism: 'SCRAM-SHA-1'}

}
};

  • 写回答

1条回答

  • 雪狼之夜 全栈领域优质创作者 2021-06-09 09:36
    关注

    你没配置config.default.js和  plugin.js 去看我这篇https://blog.csdn.net/xuelang532777032/article/details/116306479egg安装egg-mongoose 插件

    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧