getmeli / meli

Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Other
2.41k stars 97 forks source link

npx command fails when executed via Github Actions #192

Closed FritzerMcQ closed 3 years ago

FritzerMcQ commented 3 years ago

Hi, I set up a github action that will trigger a build process and publishes the build on my meli installation. Whoever using the npx command: npx @getmeli/cli upload ./build --branch [branch] --site [site] --url [url] "--token=***"

Will result in an npm error: Cannot open assembly 'upload': No such file or directory. npm ERR! code ELIFECYCLE npm ERR! errno 2

I wrapped that command as a npm script and tested the whole process on my computer. It went through without a problem. But fails when executed in github actions. How the runner calls the command up above:

     - name: Run build & deploy
       working-directory: ./landingpage
       run: |
         npm ci
         npm run build
         npm run meli -- --token=${{secrets.MELI_TOKEN}}

I neither found any hint solving the problem on the web nor in an old issue here. Thanks for helping

pimartin commented 3 years ago

Hi @FritzerMcQ,

I suspect it might be the same issue as encountered by some people with the @angular/cli.

Could you please try the following command?

npx -p @getmeli/cli meli upload ...

And if it's still not enough:

npx -p "@getmeli/cli" meli upload ...

I'll investigate further if this doesn't solve your problem.

Edit: (fixed the commands above and:) Could you also try to force npx to use the latest version of the cli (just in case)?

npx @getmeli/cli@latest upload ...
FritzerMcQ commented 3 years ago

Yes!

npx -p "@getmeli/cli" meli upload ...

this one worked fine.

Thank you!