# Override script key

**URL:** <https://travis-ci.community/t/override-script-key/7448>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [March 4, 2020, 12:53pm UTC](https://travis-ci.community/t/override-script-key/7448 "2020-03-04T12:53:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![filipallberg](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/filipallberg/32/3956_2.png) [@filipallberg](https://travis-ci.community/u/filipallberg)\
**Post date:** [March 4, 2020, 12:53pm UTC](https://travis-ci.community/t/override-script-key/7448/1 "2020-03-04T12:53:37Z")

</div>

I have a multi-stage build set-up for an open-source academic project,

> **[humlab/video\_reuse\_detector](https://github.com/humlab/video_reuse_detector)**
>
> Contribute to humlab/video\_reuse\_detector development by creating an account on GitHub.

with the corresponding .travis.yml: [https://github.com/humlab/video\_reuse\_detector/blob/master/.travis.yml](https://github.com/humlab/video_reuse_detector/blob/master/.travis.yml)

Wherein if I have the following set-up,

```
  - if ["$TRAVIS_OS_NAME" == "linux"]; then sudo apt-get install -y ffmpeg npm; fi

install:
  - 'pip install pipenv'
  - 'pipenv install --dev'
  - 'npm i --prefix frontend'

```

then my Tests stage (default name) can run without issue, but then for my named stage “App Tests” the build will fail with the following error,

```
$ npm i --prefix frontend
Please override the script: key in your .travis.yml to run tests.

```

Here is a sample instance of this happening: [https://travis-ci.com/humlab/video\_reuse\_detector/builds/151719834](https://travis-ci.com/humlab/video_reuse_detector/builds/151719834) ([https://travis-ci.com/humlab/video\_reuse\_detector/jobs/293839605](https://travis-ci.com/humlab/video_reuse_detector/jobs/293839605))

I need npm to be able to lint-check the JS-part of what is predominantly a Python code-base. How do I have these things co-exist?

---

<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:** [March 4, 2020, 1:07pm UTC](https://travis-ci.community/t/override-script-key/7448/2 "2020-03-04T13:07:37Z")

</div>

The problem is here:

> <https://github.com/humlab/video_reuse_detector/blob/f6f11f654d90f574ec8c01524f8e50d55da6a419/.travis.yml#L33-34>

`- stage: "App Tests"` is an item by itself (in an array of `jobs.include`), defining a new stage _ **and** _ a default Python job. From what you are describing, I believe what you want is to combine this line with the following job with the `script` key, so that you have:

```auto
- stage: "App Tests"
  script: docker-compose …

```

See the first example in this section of the documentation.

> **[Travis CI Documentation](https://docs.travis-ci.com/user/build-stages/#naming-your-build-stages)**
>
> Build Stages

---

<div class="post-metadata">

**Author:** ![filipallberg](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/filipallberg/32/3956_2.png) [@filipallberg](https://travis-ci.community/u/filipallberg)\
**Post date:** [March 4, 2020, 1:44pm UTC](https://travis-ci.community/t/override-script-key/7448/3 "2020-03-04T13:44:04Z")

</div>

That worked beautifully. Thank you!
