avh4/elm-format

Failing to install in Github Actions

FluidSense opened this issue ยท 3 comments

Hello ๐Ÿ‘‹

I am trying to add elm-format as a dependency to a project, but the step npm ci of my Github Action fails on a relatively simple setup.

npm ERR! -- ERROR -----------------------------------------------------------------------
npm ERR! 
npm ERR! I support your platform, but I could not find the binary package (@avh4/elm-format-linux-x64) for it!
npm ERR! 
npm ERR! This can happen if you use the "--omit=optional" (or "--no-optional") npm flag.
npm ERR! The "optionalDependencies" package.json feature is used by elm-format to install the correct
npm ERR! binary executable for your current platform. Remove that flag to use elm-format.
npm ERR! 
npm ERR! This can also happen if the "node_modules" folder was copied between two operating systems
npm ERR! that need different binaries - including "virtual" operating systems like Docker and WSL.
npm ERR! If so, try installing with npm rather than copying "node_modules".
npm ERR! 
npm ERR! NOTE: You can avoid npm entirely by downloading directly from:
npm ERR! https://github.com/avh4/elm-format/releases/tag/0.8.7
npm ERR! All this package does is distributing a file from there.
npm ERR! 
npm ERR! --------------------------------------------------------------------------------

The workflow file is as little as this:

name: Continuous Integration

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - run: npm ci
    - run: npm run build
    - run: npm test
    ```
    
Have I missed something obvious? I tried searching through previous issues, but I could not find anyone with a similar problem.

Any help appreciated!
lydell commented

Your workflow file seems to work for me: lydell/elm-github-actions-test#1

avh4 commented

Thanks for the help! Probably something to do with the package-lock as you suggest. I set my local node to same version as the runner and recreated the package-lock. That seemed to fix it!