Roots Discourse

Docker + Bedrock + Sage

Hi, I am trying to get Bedrock and Sage working fault-free on my local development environment. I’m on a Mac. I do get it to work but I get errors and I would really appreciate some help by the community!

So I have been following the guide on this Repo:

The sequence I use is:

  1. docker-compose run composer create-project
  2. docker-compose up -d
  3. docker-compose run composer create-project roots/sage web/app/themes/themename
  4. When asked for " Path to theme directory" -> /app/themes/themename
  5. cd src/web/app/themes/themename

– Here is where I get errors

  1. yarn

Produces a lot of warnings

  1. yarn build:production

Gives these errors

I can access the theme from the WP back end and activate it. It is “working” But with all the errors. Before I get into development I would like to ask what I am doing wrong and how I can eliminate these errors.

Your help is very much appreciated.

Thank you.

Have you updated “Node-sass” in the package.json file to the lastest version ?

Hi @djrasmusp

Thanks for your reply. This is what I have in my package.json file right now located at

“node-sass”: “~4.9.4”,

I changed it to “node-sass”: “~4.14.1”,

After that I run yarn and yarn build:production,

That produces these errors now:

Please advise if you can. Why am I getting all these errors, including:

ERROR Failed to compile with 2 errors

error in ./resources/assets/styles/main.scss

The error is telling you why you’re getting it: Node Sass doesn’t support your environment. It also tells you where to go to see supported environments, which is here: https://github.com/sass/node-sass/releases/tag/v4.9.4 That list stops at Node 10, so my first guess is that you have a too recent version of Node.

Although you changed the version for node-sass in your package.json you didn’t actually install the newer version because you left your yarn.lock file in place (see documentation for yarn install). You need to either

  • Delete your yarn.lock and re-run yarn
    or
  • Run yarn add node-sass@4.14.1

in order to upgrade your version of node-sass. In general you should install new packages using yarn add because that will automatically update your package.json and yarn.lock files.

1 Like

This solved the problem.

May I just ask you please, these warnings,

Where and how do I deal with them?

Appreciate your help.

You would go through your entire dependency chain and update every dependency, resolving issues as you do so. I deal with them by ignoring them; most of them are a result of old upstream dependencies which I can do little or nothing about.

Thanks again.

Right, and the dependency-chain, would that be located in the package.json file?

What other files would I need to go through?

And to update a dependency, for example “browser-sync > cokidar > Upgrade to fsevents” just as an example, would I do npm install fsevents? I guess I would need to do something in some files as well?

How to handle updating npm dependencies is beyond the scope of this forum. We try to keep this focused on the Roots stack, and while we use npm packages, in-depth support for dependency management is going to be better found elsewhere. I would recommend doing your own research on the subject: https://www.google.com/search?q=updating+npm+dependencies

Sweet. Thank you. Perfect. Really appreciate you taking your time to provide this valuable help here!