wodka/gulp-slate

Incorrect node_modules path being referenced

Closed this issue · 2 comments

I am using OS X and I receive the following error:

events.js:154
      throw er; // Unhandled 'error' event
      ^
Error: node_modules/gulp-slate/src/app.scss
Error: File to import not found or unreadable: ../node_modules/highlight.js/styles/solarized-light
       Parent style sheet: stdin
        on line 55 of stdin
>>     @import "../node_modules/highlight.js/styles/solarized-light";
   ----^

    at options.error (/Users/alex/Documents/Sites/UPP/web-api-docs/node_modules/node-sass/lib/index.js:277:32)

To fix this I had to change node_modules/gulp-slate/src/app.scss line 55 from:

@import "../node_modules/highlight.js/styles/solarized-light";

to:

@import "../../../node_modules/highlight.js/styles/solarized-light";

I do not have to do anything special to recreate this issue. All I do is follow your instructions:

npm init
npm install gulp --save-dev
npm install gulp-slate --save

Then copy / paste your example gulpfile for testing:

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

gulp.task('slate', function () {
    return gulp.src(
        [
            'node_modules/gulp-slate/node_modules/slate/source/index.html.md'
        ]
    )
        .pipe(slate())
        .pipe(gulp.dest('dist/'))
    ;
});

When I run gulp slate I get the error noted above.

I also tried with your other (browser-sync) gulpfile with the same result.

wodka commented

can you create a pull request for this change?

the reason it worked for me (not the regular case) is because slate itself was added as a node_module and not a subdependency.