Npm install kills linux build

Elliott's Avatar

Elliott

16 Aug, 2018 09:28 AM

I'm trying to setup a Linux build with a specific version of NodeJs and NPM but the build is crashing while it is installing npm.

We use NodeJs 6.7.0 and NPM 5.6.0 on our current CI, we are trying to migrate to AppVeyor. The install script is very basic.

nvm install 6.7.0

npm cache clean

npm install -g npm@5.6.0

export APPVEYOR_SSH_BLOCK=true
curl -sflL 'https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-ssh.sh' | bash -e -

I've tried stopping the build prior to the npm install -g npm@5.6.0 and running it manually, which works but when run as part of the install script it dies with the error "Build exited with code 1".

Additionally, on failure, the build also doesn't stop and allow me to SSH in. Am I doing something wrong, or is this a bug in AppVeyor? I can reproduce this consistently.

I've attached two separate build logs (removing git information)

Edit: I'm currently trying to get everything setup via the AppVeyor UI. Once it's fully operational I will be exporting to a .yml file and committing the file to the code base. For the moment however, I would like to get it working in the UI.

  1. Support Staff 1 Posted by Wasa Pleshakov on 17 Aug, 2018 09:24 PM

    Wasa Pleshakov's Avatar

    It might sound funny but... redirect npm output to /dev/null like this:

     npm install -g npm@5.6.0 > /dev/null
    
  2. Support Staff 2 Posted by Wasa Pleshakov on 17 Aug, 2018 09:45 PM

    Wasa Pleshakov's Avatar

    The workaround I posted earlier is temporary. We looking for root cause...

  3. 3 Posted by Elliott on 20 Aug, 2018 12:20 AM

    Elliott's Avatar

    Thanks for the response, while it does seem to stop the build from crashing it doesn't seem to be correctly setting the npm version.

    Running "install" scripts
    nvm install 6.7.0
    sudo npm install -g npm@5.6.0 > /dev/null
    node -v
    npm -v
    Downloading and installing node v6.7.0...
    Downloading https://nodejs.org/dist/v6.7.0/node-v6.7.0-linux-x64.tar.xz...
    ######################################################################## 100.0%
    Computing checksum with sha256sum
    Checksums matched!
    Now using node v6.7.0 (npm v3.10.3)
    v6.7.0
    3.10.3
    
  4. Support Staff 4 Posted by Wasa Pleshakov on 20 Aug, 2018 08:40 PM

    Wasa Pleshakov's Avatar

    sudo npm install install modules in /usr/lib while you need it installed in $HOME/.nvm/versions/node/6.7.0 remove sudo from your script and you should be set.

  5. 5 Posted by Elliott on 20 Aug, 2018 11:27 PM

    Elliott's Avatar

    Thanks, we've ended up going with nvm use 8 which uses npm 5.6.0, and node 8.11.3, which our build is compatible with.

  6. Support Staff 6 Posted by Wasa Pleshakov on 28 Aug, 2018 09:54 PM

    Wasa Pleshakov's Avatar
  7. Wasa Pleshakov closed this discussion on 06 Sep, 2018 01:24 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac