I’m trying to test my .travis.yml
file locally before pushing commits publicly, but I can’t get language: node_js
to spit out a build.sh
file. Other languages appear to work, so it appears to be specifically node_js
that’s the problem, but the error message is…not the least bit helpful.
What am I doing wrong here?
$ docker run --privileged --name travis -it travisci/ubuntu-ruby:18.04 /bin/bash -l
$ adduser travis
$ usermod -aG sudo travis
$ apt-get install sudo
$ su - travis
$ mkdir -p /home/travis/builds
$ cd /home/travis/builds
$ git clone https://github.com/travis-ci/travis-build.git
$ cd travis-build
$ mkdir -p /home/travis/.travis
$ ln -s $(pwd) /home/travis/.travis/travis-build
$ gem install bundler
$ bundle install --gemfile ~/.travis/travis-build/Gemfile
$ bundle update travis
$ bundler binstubs travis
$ cd ~/karanlyons/murmurHash3.js
$ cat .travis.yml
sudo: false
language: node_js
node_js:
- node
- lts/*
cache: yarn
$ ~/.travis/travis-build/bin/travis version
1.8.10
$ cat ~/.travis/config.yml
---
last_check:
etag: '"c71cbe18761a9dd51b165114df50e6dc"'
version: 1.8.10
at: 1577934780
checked_completion: true
completion_version: 1.8.10
$ ~/.travis/travis-build/bin/travis compile
E NoMethodError: undefined method `downcase' for nil:NilClass
/home/travis/builds/travis-build/lib/travis/build/script/node_js.rb:238:in `is_win?'
/home/travis/builds/travis-build/lib/travis/build/script/node_js.rb:242:in `setup_os'
/home/travis/builds/travis-build/lib/travis/build/script/node_js.rb:23:in `setup'
/home/travis/builds/travis-build/lib/travis/build/stages/builtin.rb:12:in `block in run'
/home/travis/builds/travis-build/lib/travis/shell/builder.rb:194:in `with_options'
/home/travis/builds/travis-build/lib/travis/build/stages/base.rb:15:in `with_stage'
/home/travis/builds/travis-build/lib/travis/build/stages/builtin.rb:8:in `run'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:131:in `block in run_stage'
/home/travis/builds/travis-build/lib/travis/shell/builder.rb:145:in `trace'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:130:in `run_stage'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:120:in `define_stage'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:86:in `block in run'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:85:in `each'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:85:in `run'
/home/travis/builds/travis-build/lib/travis/build/script.rb:242:in `run'
/home/travis/builds/travis-build/lib/travis/build/script.rb:148:in `sexp'
/home/travis/builds/travis-build/lib/travis/build/script.rb:127:in `compile'
/home/travis/.travis/travis-build/init.rb:51:in `run'
/var/lib/gems/2.4.0/gems/travis-1.8.10/lib/travis/cli/command.rb:198:in `execute'
/var/lib/gems/2.4.0/gems/travis-1.8.10/lib/travis/cli.rb:64:in `run'
/var/lib/gems/2.4.0/gems/travis-1.8.10/bin/travis:18:in `<top (required)>'
/home/travis/.travis/travis-build/bin/travis:29:in `load'
/home/travis/.travis/travis-build/bin/travis:29:in `<main>'
E /home/travis/builds/travis-build/lib/travis/build/script/node_js.rb:238:in `is_win?'
/home/travis/builds/travis-build/lib/travis/build/script/node_js.rb:242:in `setup_os'
/home/travis/builds/travis-build/lib/travis/build/script/node_js.rb:23:in `setup'
/home/travis/builds/travis-build/lib/travis/build/stages/builtin.rb:12:in `block in run'
/home/travis/builds/travis-build/lib/travis/shell/builder.rb:194:in `with_options'
/home/travis/builds/travis-build/lib/travis/build/stages/base.rb:15:in `with_stage'
/home/travis/builds/travis-build/lib/travis/build/stages/builtin.rb:8:in `run'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:131:in `block in run_stage'
/home/travis/builds/travis-build/lib/travis/shell/builder.rb:145:in `trace'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:130:in `run_stage'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:120:in `define_stage'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:86:in `block in run'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:85:in `each'
/home/travis/builds/travis-build/lib/travis/build/stages.rb:85:in `run'
/home/travis/builds/travis-build/lib/travis/build/script.rb:242:in `run'
/home/travis/builds/travis-build/lib/travis/build/script.rb:148:in `sexp'
/home/travis/builds/travis-build/lib/travis/build/script.rb:127:in `compile'
/home/travis/.travis/travis-build/init.rb:51:in `run'
/var/lib/gems/2.4.0/gems/travis-1.8.10/lib/travis/cli/command.rb:198:in `execute'
/var/lib/gems/2.4.0/gems/travis-1.8.10/lib/travis/cli.rb:64:in `run'
/var/lib/gems/2.4.0/gems/travis-1.8.10/bin/travis:18:in `<top (required)>'
/home/travis/.travis/travis-build/bin/travis:29:in `load'
/home/travis/.travis/travis-build/bin/travis:29:in `<main>'
echo -e ""
echo -e "There was an error in the .travis.yml file from which we could not recover.
"
echo -e "Unfortunately, we do not know much about this error."
echo -e ""
echo -e "Please review https://docs.travis-ci.com"
exit 2
config[:os]
seems to be nil
for some reason, but I don’t see any way to fix that myself.