未找到mongod命令(OS X)

时间:2018-05-11 11:45:42

标签: javascript node.js mongodb

我是新的(ish)编码和Node.js的新手。我也是Macs的新手,它有点令人困惑。我正在尝试安装Mongodb。

我已使用

成功将mongodb安装到我的项目文件夹中
var mongoose = require('mongoose')
var dbUrl = 'mongodb://user:user@ds119070.mlab.com:19070/runticle'

mongoose.connect(dbUrl, (err) => {
    console.log('mongo db connection', err)
})

我正在关注教程视频,这让这有点令人沮丧。

我尝试使用以下方法连接到我的数据库(在mlab上托管)

exec('ffmpeg -i '.config('medialibrary.s3.domain').'/listing_video/intromain.mp4'.' -vf "drawtext=fontfile='.storage_path('assets/video/FutuMd.ttf').': text='.$listing->car->name.': x=680: y=500: fontsize=55: fontcolor=white: enable=\'between(t,4,6)\'" '.Storage::put('intromainfinal.mp4', '').'');

当我运行代码时,我收到消息

mongo db connection { MongoNetworkError: failed to connect to server [ds119070.mlab.com:19070] on first connect [MongoNetworkError: connect ECONNREFUSED 54.72.66.253:19070]
    at Pool. (/Users/alfie/Desktop/code/Lindacourse/mygod/node_modules/mongodb-core/lib/topologies/server.js:505:11)
    at emitOne (events.js:116:13)
    at Pool.emit (events.js:211:7)
    at Connection. (/Users/alfie/Desktop/code/Lindacourse/mygod/node_modules/mongodb-core/lib/connection/pool.js:329:12)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at Connection.emit (events.js:214:7)
    at Socket. (/Users/alfie/Desktop/code/Lindacourse/mygod/node_modules/mongodb-core/lib/connection/connection.js:245:50)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  name: 'MongoNetworkError',
  message: 'failed to connect to server [ds119070.mlab.com:19070] on first connect [MongoNetworkError: connect ECONNREFUSED 54.72.66.253:19070]' }
(node:7587) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [ds119070.mlab.com:19070] on first connect [MongoNetworkError: connect ECONNREFUSED 54.72.66.253:19070]
    at Pool. (/Users/alfie/Desktop/code/Lindacourse/mygod/node_modules/mongodb-core/lib/topologies/server.js:505:11)
    at emitOne (events.js:116:13)
    at Pool.emit (events.js:211:7)
    at Connection. (/Users/alfie/Desktop/code/Lindacourse/mygod/node_modules/mongodb-core/lib/connection/pool.js:329:12)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at Connection.emit (events.js:214:7)
    at Socket. (/Users/alfie/Desktop/code/Lindacourse/mygod/node_modules/mongodb-core/lib/connection/connection.js:245:50)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:7587) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7587) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

当我尝试在终端上运行mongod时,它说找不到命令。

0 个答案:

没有答案