JeremyEnglert / JointsWP

A blank WordPress theme built with Foundation 6, giving you all the power and flexibility you need to build complex, mobile friendly websites without having to start from scratch.
http://jointswp.com
851 stars 272 forks source link

gulp-sass 5 error #425

Closed easYnow closed 3 years ago

easYnow commented 3 years ago

Hey all..

I've run into a new error today setting up a new dev site with JointsWP -


Error in plugin "gulp-sass" Message:

gulp-sass 5 does not have a default Sass compiler; please set one yourself. Both the sass and node-sass packages are permitted. For example, in your gulpfile:

var sass = require('gulp-sass')(require('sass'));


I've tried adding ' var sass = require('gulp-sass')(require('sass')); ' to the gulp file and a few other solutions I saw online, but no joy yet....

Is anyone else facing this issue, or know of a solution for this problem?

Thanks Tom

garretthyder commented 3 years ago

It's been a while so haven't run into this. But you can probably go one of two ways with this;

  1. Update your package.json to stop the gulp-sass devDependency before it goes to gulp-sass 5.0. It should actually be default to only 3.0.0 - <4.0.0; https://github.com/JeremyEnglert/JointsWP/blob/master/package.json#L27 If you modified this to allow 5.0 then I guess you want to look into the second option if you need gulp-sass 5.0.
  2. Use the set up they provided in your instructions; var sass = require('gulp-sass')(require('sass')); Place that in the variable chain without var or add a new line after. Then find the line with plugin.sass() and replace with just sass().

Hopefully that should help. Note: Above is all theory, I didn't test anything.

easYnow commented 3 years ago

Hi Garret,

Thanks for your suggestions, much appreciated.

I tried both of these and unfortunately neither worked for me.

I checked the package.json file and it did have "gulp-sass": "5.0.0", although I didn't edit it?! I have since changed this and still get the same error?

When I follow step 2 I get this error -

--

jointswp-sass@5.0.0 watch /Users/thomaswilson/dev/pioneer/wp-content/themes/pioneer gulp watch

Error: Cannot find module 'sass' Require stack:

Please let me know if you have any further thoughts.. Thanks Tom

easYnow commented 3 years ago

Actually I have now resolved, i needed to clear the NPM cache with the following -

npm cache clear --force npm install sass

Garret - noting your comment re 'it's been a while' do you mind me asking what you use as a 'starter' or development theme these days?

garretthyder commented 3 years ago

Nice, glad to hear you got things working there Tom. I don't develop themes for WP these days, am working with Laravel at my new position. Sorry I don't have any suggestions.