# Override only

**URL:** <https://discuss.circleci.com/t/override-only/11844>\
**Category:** Build Environment\
**Tags:** yarn, circle-yml\
**Created:** [April 11, 2017, 12:52pm UTC](https://discuss.circleci.com/t/override-only/11844 "2017-04-11T12:52:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben.swinburne](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ben.swinburne/32/11248_2.png) [@ben.swinburne](https://discuss.circleci.com/u/ben.swinburne)\
**Post date:** [April 11, 2017, 12:52pm UTC](https://discuss.circleci.com/t/override-only/11844/1 "2017-04-11T12:52:50Z")

</div>

I’ve followed the [yarn override instructions](https://circleci.com/docs/1.0/yarn/) but found that when overriding I can’t just override the `npm install` command, and have to override all inferred commands.

This prevents a few other inferred dependencies from running. For example, a normal inferred build looks as follows

```auto
Exporting NODE_ENV 00:02inference
Exporting PATH 00:02inference
$ npm install 03:49inference
composer install

```

And a build with

```auto
dependencies:
  override:
    - yarn

```

The inferred dependencies look as follows

```
$ yarn

```

Obviously I’m now missing some commands. I could add them, but I can’t find documentation on what they’re doing, and also this means that any other automatically inferred commands won’t be added.

Is there a way I can prevent npm running automatically but leave the other inferred dependencies running?

In the mean time, what exact commands would the following titled processes be running?

```auto
// Presumably export NODE_ENV=ci
Exporting NODE_ENV 00:02inference
// Unknown
Exporting PATH 00:02inference

```

Thanks

---

<div class="post-metadata">

**Author:** ![ben.swinburne](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/ben.swinburne/32/11248_2.png) [@ben.swinburne](https://discuss.circleci.com/u/ben.swinburne)\
**Post date:** [April 11, 2017, 3:08pm UTC](https://discuss.circleci.com/t/override-only/11844/2 "2017-04-11T15:08:25Z")

</div>

I have just replaced the npm binary with yarn for now rather than using overrides. The inferred commands run `npm` which actually runs yarn.

```auto
dependencies:
  pre:
    - NPM_BINARY=$(which npm); mv $NPM_BINARY .; ln -s $(which yarn) $NPM_BINARY

```

---

<div class="post-metadata">

**Author:** ![zhumo](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/zhumo/32/15902_2.png) [@zhumo](https://discuss.circleci.com/u/zhumo)\
**Post date:** [April 12, 2017, 5:57pm UTC](https://discuss.circleci.com/t/override-only/11844/3 "2017-04-12T17:57:22Z")

</div>

I have the same issue on rails (I need it to run `bundle` and `yarn`).

I’ve confirmed that your workaround works for me .

An official solution would be much appreciated!

---

<div class="post-metadata">

**Author:** ![felipero](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felipero/32/16200_2.png) [@felipero](https://discuss.circleci.com/u/felipero)\
**Post date:** [May 31, 2017, 12:38am UTC](https://discuss.circleci.com/t/override-only/11844/4 "2017-05-31T00:38:49Z")

</div>

Worked here too. Still, not the best solution I think. An oficial config would be awesome.

---

<div class="post-metadata">

**Author:** ![Kufert](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@Kufert](https://discuss.circleci.com/u/Kufert)\
**Post date:** [August 14, 2017, 3:07am UTC](https://discuss.circleci.com/t/override-only/11844/5 "2017-08-14T03:07:18Z")

</div>

I managed to get it to work by adding the following:

```
  environment:
    PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
    NODE_ENV: 'test'
    RAILS_ENV: 'test'
    RACK_ENV: 'test'
dependencies:
  override:
    - bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
    - yarn
  cache_directories:
    - ~/.cache/yarn
```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:39am UTC](https://discuss.circleci.com/t/override-only/11844/6 "2018-06-18T11:39:22Z")

</div>


