# Travis build failing (and other occassions)

**URL:** <https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546>\
**Category:** Learn\
**Created:** [April 24, 2019, 10:34pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546 "2019-04-24T22:34:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [April 24, 2019, 10:34pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/1 "2019-04-24T22:34:03Z")

</div>

My travis builds have started failing (I’ve actually seen the same behaviour when installing Elm webpack hot loader too). This is the error:

```auto
npm install -g elm@0.19
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
/home/travis/.nvm/versions/node/v12.0.0/bin/elm -> /home/travis/.nvm/versions/node/v12.0.0/lib/node_modules/elm/bin/elm
> elm@0.19.0 install /home/travis/.nvm/versions/node/v12.0.0/lib/node_modules/elm
> binwrap-install
fs.js:27
const { Math, Object, Reflect } = primordials;
                                  ^
ReferenceError: primordials is not defined
    at fs.js:27:35
    at req_ (/home/travis/.nvm/versions/node/v12.0.0/lib/node_modules/elm/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/home/travis/.nvm/versions/node/v12.0.0/lib/node_modules/elm/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/home/travis/.nvm/versions/node/v12.0.0/lib/node_modules/elm/node_modules/unzip/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! elm@0.19.0 install: `binwrap-install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the elm@0.19.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/travis/.npm/_logs/2019-04-24T22_28_56_713Z-debug.log
The command "npm install -g elm@0.19" failed and exited with 1 during .

```

Does anyone have a clue? I’ve failed to downgrade nodejs or npm with Travis, but I’ve seen the same problem on my own system actually with nodejs 10 and npm 6.4.1. So I don’t believe it’s related to that.

It suddenly started, just two days ago everything was fine.

---

<div class="post-metadata">

**Author:** ![Sidney](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/sidney/32/3290_2.png) [@Sidney](https://discourse.elm-lang.org/u/Sidney)\
**Post date:** [April 24, 2019, 11:39pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/2 "2019-04-24T23:39:33Z")

</div>

According to that stacktrace, it looks like node 12 is being used? Perhaps, as that deprecation notice is saying, changes to Node 12 have broken the `natives` package. That kind of checks out, Node 12 was released about 2 days ago!

Maybe you should configure Travis to use Node 11 or Node 10.

---

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [April 25, 2019, 1:16am UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/3 "2019-04-25T01:16:47Z")

</div>

As I had seen the same error on my machine I believe, I was a bit sceptical but spurred on by your post did some more digging and was able to specify a nodejs 10 version this time. And indeed, that fixes it!

---

<div class="post-metadata">

**Author:** ![andys8](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/andys8/32/280_2.png) [@andys8](https://discourse.elm-lang.org/u/andys8)\
**Post date:** [April 25, 2019, 12:15pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/4 "2019-04-25T12:15:58Z")

</div>

I tried to reproduce the issue with Node 12. I think the issue is already solved. It’s failing because the elm node wrapper version is installed with tag `0.19` which was the first version for `elm 0.19` and is 8 months old. The `latest` version `0.19.0-bugfix6` is working fine for me. It can be used by installing `elm` or `elm@latest` or `elm@elm0.19.0` (see list of [versions](https://www.npmjs.com/package/elm?activeTab=versions) So I guess you can keep using the node version you want to use.

### Node 12 and old elm wrapper version

```auto
node -v                                                                                                                                                                
v12.0.0

npm i -g elm@0.19                                                                                                                                                      
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
/home/as/.fnm/node-versions/v12.0.0/installation/bin/elm -> /home/as/.fnm/node-versions/v12.0.0/installation/lib/node_modules/elm/bin/elm

> elm@0.19.0 install /home/as/.fnm/node-versions/v12.0.0/installation/lib/node_modules/elm
> binwrap-install

fs.js:27
const { Math, Object, Reflect } = primordials;
                                  ^

ReferenceError: primordials is not defined
    at fs.js:27:35
    at req_ (/home/as/.fnm/node-versions/v12.0.0/installation/lib/node_modules/elm/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/home/as/.fnm/node-versions/v12.0.0/installation/lib/node_modules/elm/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/home/as/.fnm/node-versions/v12.0.0/installation/lib/node_modules/elm/node_modules/unzip/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! elm@0.19.0 install: `binwrap-install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the elm@0.19.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/as/.npm/_logs/2019-04-25T12_09_16_709Z-debug.log

```

### Node 12 and current elm wrapper version

```auto
npm i -g elm@elm0.19.0                                                                                                                                            
/home/as/.fnm/node-versions/v12.0.0/installation/bin/elm -> /home/as/.fnm/node-versions/v12.0.0/installation/lib/node_modules/elm/bin/elm

> elm@0.19.0-bugfix6 install /home/as/.fnm/node-versions/v12.0.0/installation/lib/node_modules/elm
> binwrap-install

+ elm@0.19.0-bugfix6
added 79 packages from 70 contributors in 4.778s

```

---

<div class="post-metadata">

**Author:** ![unsoundscapes](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/unsoundscapes/32/410_2.png) [@unsoundscapes](https://discourse.elm-lang.org/u/unsoundscapes)\
**Post date:** [April 25, 2019, 4:33pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/5 "2019-04-25T16:33:15Z")

</div>

I also switched to elm@0.19.0-bugfix6 in the projects where it failed, but maybe the right way would be to start using Elm directly [https://docs.travis-ci.com/user/languages/elm/](https://docs.travis-ci.com/user/languages/elm/)

---

<div class="post-metadata">

**Author:** ![catz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/catz/32/1007_2.png) [@catz](https://discourse.elm-lang.org/u/catz)\
**Post date:** [April 25, 2019, 5:19pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/6 "2019-04-25T17:19:17Z")

</div>

I got the same error when I tried to install elm via npm. this command worked for me sudo npm install --unsafe-perm -g elm

---

<div class="post-metadata">

**Author:** ![berend](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/berend/32/2250_2.png) [@berend](https://discourse.elm-lang.org/u/berend)\
**Post date:** [April 25, 2019, 8:54pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/7 "2019-04-25T20:54:20Z")

</div>

Ah that’s cool. Do we know what is in the Elm bug fixes?

---

<div class="post-metadata">

**Author:** ![ilias](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ilias/32/6_2.png) [@ilias](https://discourse.elm-lang.org/u/ilias)\
**Post date:** [April 25, 2019, 9:11pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/8 "2019-04-25T21:11:25Z")

</div>

Only changes to the installer, mostly mitigations for npm audit warnings. The actual binaries for Elm did not change.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [May 5, 2019, 9:11pm UTC](https://discourse.elm-lang.org/t/travis-build-failing-and-other-occassions/3546/9 "2019-05-05T21:11:30Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
