You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Travis中安装Elixir并禁用默认Mix项目检查命令

How to disable Travis CI's Mix project check when only installing Elixir (iex) without a Mix project?

Problem Description

I've configured my .travis.yml with the following content:

language: node_js
node_js:
  - 6.10
language: elixir
elixir:
  - 1.2.2
otp_release:
  - 18.2.1

But when running on Travis CI, I get this error:

** (Mix) Could not find a Mix.Project, please ensure a mix.exs file is available
The command "mix deps.get" failed and exited with 1 during .

I don't have an Elixir project file; I just want to install Elixir (and use iex) on Travis. How can I disable Travis' Mix project check?


Answer

This issue comes from Travis CI having default build steps for Elixir projects—by default, it automatically runs mix deps.get and other Mix-related commands, which require a mix.exs file to exist. To get around this, you just need to override Travis' default script with a command that won't trigger Mix project checks.

Here's how to adjust your .travis.yml:

language: node_js
node_js:
  - 6.10
language: elixir
elixir:
  - 1.2.2
otp_release:
  - 18.2.1
# Override default script to skip Mix project validation
script:
  # A simple message to confirm the environment is set up properly
  - echo "Elixir and OTP are ready to use"
  # If you need to run iex commands (note: Travis is non-interactive, so use `-e` for inline execution)
  - iex -e "IO.puts('Hello from IEx!'); System.halt()"

If you only need to install the Elixir environment without running any extra commands, you can even set the script to true—this is a no-op command that always succeeds:

script: true

With this change, Travis will still install the specified Elixir and OTP versions as you configured, but it won't attempt to look for a mix.exs file or execute any default Mix commands.


内容的提问来源于stack exchange,提问作者martin doe

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:14:00