Roots Discourse

Troubles deploying project with Sage 10: caused by node 16 required

Hi all,

After working on different projects with Sage 9 without any issues, I face now this problem:
Recently I init a new Trellis project via trellis-cli. It created a new vagrant based on pjp8 (few month ago, was php7).
I installed Sage 9, but faced many warnings and deprecated messages. I think it may be caused by Sage 9 not updated to work with php8.

So I tried to use Sage 10, successfully on my local Vagrant.
I did that this way, succesfully:
composer create-project roots/sage site/web/app/themes/my-theme-name dev-master

On locally yarn build I had to switch my Node version because of this error :

error sage@: The engine "node" is incompatible with this module. Expected
version ">=16.0.0". Got "14.5.0"

After that, everything is ok locally.
But when I execute trellis deploy production, I face the same error.

Is there a way to tell Trellis to download and use Node 16 by default?
Am I doing something wrong?

Thanks a lot

Ok so it looks I totally misunderstood how does the production build works:

  • I have 2 terminal windows :
    • 1 for Trellis
    • 1 for theme build yarn, git stuff, and so on…
      I switched to Node 16 version on the second one, so build was ok, but I didn’t switch Node.js version on my terminal window used for Trellis.
  • That’s how I discovered that assets build is done LOCALLY!

I discovered something today, so I’m really happy, and alos feels totally dumb :man_facepalming:

Well, that is a great first topic for me on this Discourse :smiley:

1 Like

Yup, that took me a while too :slight_smile:
You can use nvm and it’s .nvmrc files to avoid these kind of problems in the future!

1 Like

Thanks a lot for the suggestion with .nvlrc file. I read that before understanding how Node version is managed and didn’t understand. Now it’s clear :slight_smile:

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.