File to import not found or unreadable: compass/reset.

F:\newpagebao\happybao\stc (master)
λ gulp serve
[15:02:21] Working directory changed to F:\newpagebao
[15:02:22] Using gulpfile F:\newpagebao\gulpfile.js
[15:02:22] Starting 'sass'...
[15:02:22] error happybao/stc/scss/idx.scss (Line 1: File to import not found or unreadable: compass/reset.)
[15:02:22] Finished 'sass' after 455 ms
[15:02:22] Starting 'serve'...
[15:02:22] Finished 'serve' after 43 ms
[BS] Access URLs:
 -------------------------------------
       Local: http://localhost:3000
    External: http://192.168.1.14:3000
 -------------------------------------
          UI: http://localhost:3001
 UI External: http://192.168.1.14:3001
 -------------------------------------
[BS] Serving files from: ./happybao/stc

clipboard.png

gulpfile-settings:

var minifycss = require('gulp-minify-css'),// CSS压缩
    uglify = require('gulp-uglify'),// js压缩
    concat = require('gulp-concat'),// 合并文件
    rename = require('gulp-rename'),// 重命名
    clean = require('gulp-clean');//清空文件夹

var gulp = require('gulp'),
    sass = require('gulp-ruby-sass'),
    sourcemaps = require('gulp-sourcemaps'),
    filter = require('gulp-filter');
    notify = require('gulp-notify'),
    plumber = require('gulp-plumber');
    browserSync = require('browser-sync').create(),
    reload     = browserSync.reload;

gulp.task('serve', ['sass'], function() {
    browserSync.init({
        server: "./happybao/stc"
    });
    gulp.watch("happybao/**/*.scss", ['sass']);
    gulp.watch("happybao/**/*.html").on('change', reload);
});
gulp.task('sass', function() {
    return   sass(['happybao/stc/scss/*.scss','!happybao/stc/scss/extend/{reset,test}.scss'],{sourcemap:true})
        //.pipe(sourcemaps.init())
        .on('error',function(err) {
            notify().write(err);
            this.emit('end');
        })
        .pipe(sourcemaps.write('../maps'))
        .pipe(gulp.dest('happybao/stc/css'))// Write the CSS & Source maps
        .pipe(filter('happybao/**/*.css')) // Filtering stream to only css files
        .pipe(reload({stream: true}));//必须要
});
gulp.task('default', ['serve']);
阅读 4.9k
2 个回答

compass装了么?

gem install compass

还有你用的是gulp-sass还是什么东西在做这件事?这个问题最好还是从使用的插件着手

既然打算用compass,为什么不用gulp-compass这个插件呢
应该是这个问题,调用compass需要compass watch,所以直接使用sass可能不行
https://github.com/appleboy/gulp-compass

宣传栏