简体   繁体   中英

install nodejs with mongodb and node js run but mongo db establish connect test and then some error network failed

install nodejs with mongodb and node js run but mongo db establish connect test and then some error network failed

$ mongo

errno:10061 No connection could be made because the target machine actively refused it.

图片

Your using the wrong executable. Instead of mongo use mongod - it starts the mongo server. mongo is for editing/adding stuff to the database from the console. You don't need it. For node all you need is mongod

Example: cd mongodb > mongod

If error message comes up about data/db not set, add a folder called data with a subfolder db in C/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM