Github Actions not made for yarn?

Greetings,

I have a problem with my Projects where i use Yarn. it somehow give allways this error:

Does this correlate with this line:

      - uses: bahmutov/npm-install@v1

Your deployment script can see if it’s a NPM or Yarn Project. But from what i gathered this one does not play nicely with yarn.

Thanks if you can give a hint. I think your automatic deployment made me a little bit to easy around this stuff.

thanks a lot :slight_smile:

This doesn’t have anything to do with Yarn, I think. What’s happening is that GitHub Actions is using the latest NodeJS 16 by default but your project’s package.json is only compatible with NodeJS between 10 and 14. You can do one of two things:

Either:

Update your package.json file to also accept 16.

Or:
Update the workflow file created by Cleavr in your repo to add the following step:


      - uses: actions/setup-node@v1
        with:
          node-version: '14’

Thank for your reply.

Any way to determine what Node Version is on the server and therefore use the corresponding github actions workflow script?

I mean: Ist it something you plan to implement into cleavr so that no manual work is required and we can still use node 14?

This basically forces one to use node 16 or touch the workflow file everytime we deploy a new project with GHA.

You can view the Node version in server > services section. Also, checking the heartbeat will show versions of some other services as well:
CleanShot 2022-01-16 at 15.00.24

Are you asking if you can have multiple versions of Node running and have an app assigned to use one of them? If so - this is something we’ve tried to allow for in the past but didn’t have any luck. We plan on looking at other ways to allow for it.

Thanks for your reply.

Actually i was thinking of handling this cleavr-side.

So that when cleavr is creating an GHA-Script it checks for the node version on which the process is/should be running so that the appropriate script will be checked into git.

Would be awesome as it does not require us to change the node version manually in the GHA-Script everytime we set up a deployment.

Just a thought though!

1 Like

That makes perfect sense!

And thanks for your suggestion, it has already been implemented and is currently going through the QA. You can expect this to go live either today or tomorrow. I’ll let you know once it is deployed.

1 Like

I’m sorry it this is of topic but i’m a npm-guy.

Many tutorials and repos use yarn and this has bothered me as i thought i had to stick with nmp to use Cleavr so i have.

Now i get the feeling i can use yarn in Cleavr and if so what would be “the gain” from npm?

Have a nice day :slight_smile:

From my little experience in yarn:

i think yarn is generally faster which should make your deployments faster as well.

Cleavr will check for the yarn.lock file during deployments and will use yarn over npm. I think we have an opportunity for improvement to make somewhere so that is more clear. :slight_smile:

1 Like

I was a hardcore Yarn user as well but, thanks to Yarn pushing for it, npm’s performance has significantly improved - in some cases it even defeats Yarn :scream:. If you have the lock file checked in, which you should, the performance advantage is very negligible.

One big advantage of npm is that it is the standard and very stable.

There is a new kid on the block - pnpm, which actually brings significant speed improvements. We might support this down the road. But again, how long before npm actually integrates some of the concepts introduced by pnpm and catch up with the speed?

https://p.datadoghq.eu/sb/d2wdprp9uki7gfks-c562c42f4dfd0ade4885690fa719c818?tpl_var_npm=*&tpl_var_pnpm=*&tpl_var_yarn-classic=*&tpl_var_yarn-modern=*&tpl_var_yarn-nm=*&tpl_var_yarn-pnpm=no&from_ts=1641916670626&to_ts=1642521470626&live=true

4 Likes

Thank you @ashok

I can then stick with npm without being ”an anti future guy” :slight_smile:

I use two frameworks

Quasar for frontend and they have their own CLI but are saying under Getting started ”An App Extension is an npm package.” So I feel comfortable to use npm ”all the way”

Adonis for backend and the say under Creating a new project "You can create a new project using npm init , yarn create or pnpm create.” So I guess Virk don’t mind npm.

Please tell me if sticking with npm is okay?

Have a nice day

Nothing wrong with sticking with npm. That’s exclusively what I use nowadays and have never had any issues with it.

2 Likes