mongoDB error: Error: failed to connect to [localhost:27017]

后端 未结 6 475
失恋的感觉
失恋的感觉 2021-02-06 12:45

I\'m trying to install habitrpg locally but I keep getting a mongoDB error after typing node src/seed.js:

Error: failed to connect to [localhost:270         


        
6条回答
  •  走了就别回头了
    2021-02-06 12:58

    I got this issue because I didn't have MongoDB. SO Installed MongoDB and tried to run node application and it worked.

    If you don't have MongoDB then follow below steps to install and enjoy

    Commands :

    $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
    
    $ echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
    
    $ sudo apt-get update
    
    $ sudo apt-get install -y mongodb-org
    

    then type mongo in terminal and if you will get console for mongo then its done.

提交回复
热议问题