Not an option in the Version Selector: 8.x-7.0-alpha14

This is happening on two sub-themes I created.
In a nearly naked one, and one that was working well a few months ago.

When I run 'gulp' I got an error:

[21:55:24] Using gulpfile ~/public_html/sites/default/themes/contrib/aa_zen_subtheme/gulpfile.js
[21:55:24] Starting 'clean:css'...
[21:55:24] Starting 'clean:styleguide'...
[21:55:24] Starting 'styleguide:kss-example-chroma'...
[21:55:24] Starting 'lint:sass'...
[21:55:24] Starting 'lint:js-with-fail'...
[21:55:24] Finished 'clean:css' after 430 ms
[21:55:24] Starting 'styles:production'...
/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:402
            throw e;
            ^

Error: Cannot find module 'eslint-config-airbnb'
Referenced from: /home/amazingd8/public_html/core/.eslintrc.json
Referenced from: /home/amazingd8/public_html/.eslintrc.json
    at Object.resolve (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/util/module-resolver.js:75:19)
    at resolve (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:479:33)
    at load (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:496:24)
    at /home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:392:36
    at Array.reduceRight (native)
    at applyExtends (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:363:28)
    at load (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:530:22)
    at /home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:392:36
    at Array.reduceRight (native)
    at applyExtends (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:363:28)
    at Object.load (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config/config-file.js:530:22)
    at loadConfig (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config.js:64:33)
    at getLocalConfig (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config.js:126:23)
    at Config.getConfig (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/config.js:227:22)
    at processText (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/cli-engine.js:223:27)
    at CLIEngine.executeOnText (/home/amazingd8/public_html/sites/default/themes/contrib/aa_zen_subtheme/node_modules/eslint/lib/cli-engine.js:761:26)

I can edit gulpfile.js and force the error away by removing the 'lint:js' part from the lint task

gulp.task('lint', ['lint:sass', 'lint:js']);

to

gulp.task('lint', ['lint:sass']);

But this is not really a solution.

I have installed the requested eslint-config-airbnb manually with npm, but then there are just more missing modules.

Is anyone else having this problem?

dmduke

CommentFileSizeAuthor
#4 2934512.patch1.16 KBamjad1233
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dmduke created an issue. See original summary.

dmducc’s picture

OK, I think I have some better information now.
I was able to get the gulp build to work locally.

On stage:
$ gulp -version
CLI version 1.3.0
Local version 3.9.1

Locally:
$ gulp -version
CLI version 1.2.1
Local version 3.9.1

And that makes all the difference.

I can see from the package.json that Zen will use:
"gulp": "^3.9.1",

So does this become a SySAdmin issue.
Do I need to get the SysAdmin to configure the global gulp install (CLI)?
Does this help anyone help me?

dmduke

frob’s picture

You should turn off gulp linting and use cli based linting. The latest version of es-lint doesn't support it. Another possibility is if we can use an older version of airbnb styleguide.

amjad1233’s picture

FileSize
1.16 KB

Hi @dmduke,

Please apply this patch and try.

I have updated all the modules and I have tested it works.

Would love to hear your reviews.

Regards,
Amjad

tstermitz’s picture

@amjad.

[Edit: Well I spoke too soon. on Mac OS, I needed to update gulp-sass to 3.1.0 to get around an error trying to download node-sass@3.13.1]

My gulp successfully compiled using the package.json you suggest...

I'm on Ubuntu 16.04 with a lot of the latest versions of things - Drupal 8.5.0 and Zen 8.x-7.0-alpha-14. I've updated npm -v 5.6.0 and node -v v8.10.0

I simply copied in package.json to my Zen 7.0-alpha-24 sub theme and used the suggested patches. I had to recompile all the node_modules to deal with my updated node and npm.

To cut down on the noise, I also commented out the gulpfile.js from the eslint section in gulpfile.js
// Define the paths to the JS files to lint.
options.eslint = {
files : [
//options.rootPath.project + 'gulpfile.js',
options.theme.js + '**/*.js',
'!' + options.theme.js + '**/*.min.js',
options.theme.components + '**/*.js',
'!' + options.theme.build + '**/*.js'
]
};

dmducc’s picture

OK, thanks for the response. Sorry for the late delay, but I was never notified that this post got any response.
Got to check that spam filter.

I have NOT had time to try the patch yet. BUT I did end up finding a solution.

In the file: {my_subtheme}/.eslintrc
I did this:

{ 
  "root": true, 
  "extends": "eslint:recommended", 
  "env": { 
  "browser": true 
},

By adding: "root": true,
I was able to rely on the version I wanted to use.

BUT, this is by far and away my favourite theme. I use it for ALL my Drupal builds. So I will be able to test the patch soon.

Found this old issue when I was searching for a solution to my new issue related to Drush 9.
But that doosey will have to wait till Monday. See you then!

And thanks again!

dmduke

pakmanlh’s picture

Status: Active » Reviewed & tested by the community

The patch on #4 works perfectly. Thank you very much @4amjad1233