# Build Config Validation: Using \`api\_key\` breaks npm deployments

**URL:** <https://travis-ci.community/t/build-config-validation-using-api-key-breaks-npm-deployments/6696>\
**Category:** Build Config Validation\
**Tags:** config-validation\
**Created:** [January 2, 2020, 12:38pm UTC](https://travis-ci.community/t/build-config-validation-using-api-key-breaks-npm-deployments/6696 "2020-01-02T12:38:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankon](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/ankon/32/944_2.png) [@ankon](https://travis-ci.community/u/ankon)\
**Post date:** [January 2, 2020, 12:38pm UTC](https://travis-ci.community/t/build-config-validation-using-api-key-breaks-npm-deployments/6696/1 "2020-01-02T12:38:22Z")

</div>

Relevant deployment config:

```auto
deploy:
  skip_cleanup: true
  provider: npm
  email: "email removed"
  api_key:
    secure: "secure value removed"
  on:
    tags: true
    condition: $(node -e 'console.log("v" + require("./package.json").version)') = ${TRAVIS_TAG}

```

When build config validation is enabled it reports something along the lines of "`api_key` is alias for `api_token`, using `api_token`". The build then fails at deployment time with:

```auto
Installing deploy dependencies
Successfully installed dpl-npm-1.10.14
1 gem installed

Preparing deploy
NPM version: 6.13.4
missing api_key

failed to deploy

```

Disabling build config validation makes the deployment to npm work as expected.

Note:

1. Copy-pasting log content into this community is ugly, so I may have borked the whitespaces there.
2. Disabling build config validation also disables it for all previous builds, so I could not go back and copy-paste the exact messages. I think you guys should keep the output of the validation results per-build …
3. If needed: Failing build is [https://travis-ci.com/Collaborne/collaborne-polaris-content/jobs/271793747](https://travis-ci.com/Collaborne/collaborne-polaris-content/jobs/271793747), passing build was manually triggered after disabling the validation through the UI and is [https://travis-ci.com/Collaborne/collaborne-polaris-content/builds/142868814](https://travis-ci.com/Collaborne/collaborne-polaris-content/builds/142868814)

EDIT: Reverse api\_key/\_token

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [January 2, 2020, 2:16pm UTC](https://travis-ci.community/t/build-config-validation-using-api-key-breaks-npm-deployments/6696/2 "2020-01-02T14:16:41Z")

</div>

Duplicate of

> [@Npm deploy failed && missing api\_key, but I have set it](https://travis-ci.community/t/npm-deploy-failed-missing-api-key-but-i-have-set-it/6624):
>
> this is my build history and .travis.yml config: [https://travis-ci.org/DWmister/build-pack/jobs/629531172/config](https://travis-ci.org/DWmister/build-pack/jobs/629531172/config) Also, I don’t know why this happens?, use v1 ‘api\_key’ ----- ‘api\_token’ In addition, I also used the v2. In v2, I know ‘api\_token’ alias: ‘api\_key’,but,Same problem as above [https://travis-ci.org/DWmister/build-pack/jobs/629535399/config](https://travis-ci.org/DWmister/build-pack/jobs/629535399/config) finally,I have set Environment Variables.

---

<div class="post-metadata">

**Author:** ![ankon](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/ankon/32/944_2.png) [@ankon](https://travis-ci.community/u/ankon)\
**Post date:** [January 3, 2020, 9:11am UTC](https://travis-ci.community/t/build-config-validation-using-api-key-breaks-npm-deployments/6696/3 "2020-01-03T09:11:22Z")

</div>

@native-api: Try disabling “Build Config Validation” in the Travis settings, and trigger a new build. Indeed you are likely seeing exactly the problem I described above.

---

<div class="post-metadata">

**Author:** ![elviswolcott](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/elviswolcott/32/3608_2.png) [@elviswolcott](https://travis-ci.community/u/elviswolcott)\
**Post date:** [January 12, 2020, 6:38am UTC](https://travis-ci.community/t/build-config-validation-using-api-key-breaks-npm-deployments/6696/4 "2020-01-12T06:38:45Z")

</div>

I had the same issue and disabling “Build Config Validation” did in fact do the trick

---

<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:** [February 24, 2020, 2:01pm UTC](https://travis-ci.community/t/build-config-validation-using-api-key-breaks-npm-deployments/6696/5 "2020-02-24T14:01:44Z")

</div>

Hello, there. We’ve released dpl 1.10.15, which fixes this issue (for those staying on v1.x at the moment).

> **[dpl 1.10.15 is released - Travis CI changelog](https://headwayapp.co/travis-ci-changelog/dpl-1-10-15-is-released-138589)**
>
> We have released version 1.10.15 of our deployment utility, dpl.
> This release fixes the authentication issue with the...
