Travis build failing (and other occassions)

#1

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

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.

1 Like
#2

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.

#3

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!

#4

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 So I guess you can keep using the node version you want to use.

Node 12 and old elm wrapper version

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

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
2 Likes
#5

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/

1 Like
#6

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

#7

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

#8

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

3 Likes
closed #9

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