# Mongodb service does not start on windows

**URL:** <https://travis-ci.community/t/mongodb-service-does-not-start-on-windows/445>\
**Category:** Windows\
**Created:** [October 21, 2018, 5:38pm UTC](https://travis-ci.community/t/mongodb-service-does-not-start-on-windows/445 "2018-10-21T17:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cemremengu](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/cemremengu/32/245_2.png) [@cemremengu](https://travis-ci.community/u/cemremengu)\
**Post date:** [October 21, 2018, 5:38pm UTC](https://travis-ci.community/t/mongodb-service-does-not-start-on-windows/445/1 "2018-10-21T17:38:47Z")

</div>

Using the same script for linux platform, mongodb tests will give error

`failed to connect to server [127.0.0.1:27017] on first connect`

here is the travis.yml

```
language: node_js
os:
  - windows
  - linux
  
node_js:
  - "8"
  - "6"
  - "10"

services:
  - mongodb

notifications:
  email:
    on_success: never
    on_failure: always

```

I tried adding:

```
before_script:
  - mongod

```

but no luck (says unknown command)

Is there anything else that needs to be done on windows?

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [October 21, 2018, 10:27pm UTC](https://travis-ci.community/t/mongodb-service-does-not-start-on-windows/445/2 "2018-10-21T22:27:01Z")

</div>

`services` in general at the moment assumes Linux.

---

<div class="post-metadata">

**Author:** ![josh](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/josh/32/12_2.png) [@josh](https://travis-ci.community/u/josh)\
**Post date:** [October 22, 2018, 1:27am UTC](https://travis-ci.community/t/mongodb-service-does-not-start-on-windows/445/3 "2018-10-22T01:27:23Z")

</div>

Hi @cemremengu

We don’t currently pre-install mongodb. You can install it in a `before_install` step using `choco install mongodb`, but you will want to add an if condition so that it is only install when `TRAVIS_OS_NAME` is `windows`.
