Failing to install in Github Actions
FluidSense opened this issue ยท 3 comments
FluidSense commented
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
Yeah, I haven't heard of this before. Personally I'd maybe be looking at:
- is there something bad in the package-lock.json? Maybe as a test make a
clean updated one `rm package-lock.json; npm install` and see if that helps
anything?
- maybe there's something bad in the cache -- can you clear the cache or
run a build without the cache?
- are you using github's hosted runners, or do you have your own runners?
if the latter, maybe something is weird on the runners themselves?
โฆOn Wed, Aug 2, 2023 at 9:55โฏAM Simon Lydell ***@***.***> wrote:
Your workflow file seems to work for me: lydell/elm-github-actions-test#1
<lydell/elm-github-actions-test#1>
โ
Reply to this email directly, view it on GitHub
<#821 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAJRSOMNFVNFQCMW5LEE3XTKBA3ANCNFSM6AAAAAA3BLMCVA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
FluidSense 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!