Problems with Papers theme related to gulp

Hi - I’ve installed the Papers theme per https://omeka.org/s/themes/papers/. To use Sass with the Scripto theme (included in Papers), you need to run:

“npm install” and
“gulp scripto”

within the root of the Papers theme.

When I run “npm install” I get the following error:

[root@cloud71854 papers]# npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/glob-watcher/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

I’m assuming SKIPPING OPTIONAL DEPENDENCY for fsevents isn’t causing a problem.

However, likely more significantly, when I run “gulp scripto” I get the following error:

[root@cloud71854 papers]# gulp scripto
[09:21:33] Using gulpfile /home/trcadmin/public_html/themes/papers/gulpfile.js
[09:21:33] Starting ‘scripto’…
[09:21:33] Starting ‘compileCss’…
[09:21:33] ‘compileCss’ errored after 243 ms
[09:21:33] TypeError: require(…).with is not a function
at compileCss (/home/trcadmin/public_html/themes/papers/gulpfile.js:13:62)
at bound (domain.js:416:15)
at runBound (domain.js:427:12)
at asyncRunner (/home/trcadmin/public_html/themes/papers/node_modules/async-done/index.js:55:18)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
[09:21:33] ‘scripto’ errored after 247 ms

I’d appreciate help resolving the error with “gulp scripto” .

Thanks a lot,

Paul

Hi Paul, this is something that is about to be fixed in the next release. In your theme directory, can you go to gulpfile.js and replace line 4 with the following:

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

After that, try running gulp scripto again.

Hi Kim -

I applied the patch - and get this error msg:

[root@cloud71854 papers]# gulp scripto
[12:42:36] Using gulpfile /home/trcadmin/public_html/themes/papers/gulpfile.js
[12:42:36] Starting ‘scripto’…
[12:42:36] Starting ‘compileCss’…
[12:42:36] ‘compileCss’ errored after 481 ms
[12:42:36] TypeError: require(…).with is not a function

  • at compileCss (/home/trcadmin/public_html/themes/papers/gulpfile.js:13:62)*
  • at bound (domain.js:416:15)*
  • at runBound (domain.js:427:12)*
  • at asyncRunner (/home/trcadmin/public_html/themes/papers/node_modules/async-done/index.js:55:18)*
  • at processTicksAndRejections (internal/process/task_queues.js:77:11)*
    [12:42:36] ‘scripto’ errored after 485 msemphasized text*

FYI - here’s the gulpfile.js:

‘use strict’;

var gulp = require(‘gulp’);

function compileCss() {

  • var sass = require(‘gulp-sass’)(require(‘sass’));*

  • var postcss = require(‘gulp-postcss’);*

  • var autoprefixer = require(‘autoprefixer’);*

  • return gulp.src(’./asset/sass/**/.scss’)

  •    .pipe(sass({*
    
  •        outputStyle: 'compressed',*
    
  •        includePaths: require('node-normalize-scss').with('../../node_modules/susy/sass')*
    
  •    }).on('error', sass.logError))*
    
  •    .pipe(postcss([*
    
  •        autoprefixer({browsers: ['> 5%', '> 5% in US', 'last 2 versions']})*
    
  •    ]))*
    
  •    .pipe(gulp.dest('./asset/css'));  *
    

}

function buildScriptoTheme() {

  • return gulp.src(’./asset/css/scripto/papers.css’)*
  •    .pipe(gulp.dest('../../modules/Scripto/asset/css/site-themes'));*
    

}

gulp.task(‘css’, compileCss);

gulp.task(‘scripto’, gulp.series(compileCss, buildScriptoTheme));

gulp.task(‘css:watch’, function () {

  • gulp.watch(’./asset/sass/.scss’, gulp.parallel(‘css’));
    });

gulp.task(‘scripto:watch’, function () {

  • gulp.watch(’./asset/sass/**/.scss’, gulp.parallel(compileCss, buildScriptoTheme));
    });

Paul

Okay, let’s try replacing your whole gulpfile.js with the most updated version here: https://raw.githubusercontent.com/omeka-s-themes/papers/master/gulpfile.js