title: UnhandledPromiseRejectionWarning: MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
body: <p>i downloaded mongoDB and it works just fine but when i want to use REST API and use <code>npm run dev</code> in command line it gave me this error..
  <a href="https://i.stack.imgur.com/ZR8Rn.jpg" rel="nofollow noreferrer">That's an error</a></p>
  <pre><code>(node:10100) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
      at NativeConnection.Connection.openUri (D:\Node Js\task-manager\node_modules\mongoose\lib\connection.js:800:32)
      at D:\Node Js\task-manager\node_modules\mongoose\lib\index.js:341:10
      at D:\Node Js\task-manager\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:5
      at new Promise (&lt;anonymous&gt;)
      at promiseOrCallback (D:\Node Js\task-manager\node_modules\mongoose\lib\helpers\promiseOrCallback.js:30:10)
      at Mongoose.connect (D:\Node Js\task-manager\node_modules\mongoose\lib\index.js:340:10)
      at Object.&lt;anonymous&gt; (D:\Node Js\task-manager\src\db\mongoose.js:3:10)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
      at Module.load (internal/modules/cjs/loader.js:985:32)
      at Function.Module._load (internal/modules/cjs/loader.js:878:14)
      at Module.require (internal/modules/cjs/loader.js:1025:19)
      at require (internal/modules/cjs/helpers.js:72:18)
      at Object.&lt;anonymous&gt; (D:\Node Js\task-manager\src\index.js:2:1)
      at Module._compile (internal/modules/cjs/loader.js:1137:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
  (node:10100) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
  (node:10100) [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.
  </code></pre>
  <p>and before that when i wanted to connect database and project it work but now its not work and when i try to connect it is stopping
  <a href="https://i.stack.imgur.com/pBEZu.jpg" rel="nofollow noreferrer">And thats not connecting picture</a></p>