【gulp-sass】error: File to import not found or unreadable
简要记录一下在使用gulp-sass时候踩的坑,虽然不明所以然,但是似乎在https://github.com/dlmanning/gulp-sass/issues/1 找到了答案。
在使用gulpfile配置监听文件更新自动编译时候出现了一个这个错误:“error: File to import not found or unreadable: ./m-body”
而且会出现一种奇怪的现象,当改动某个文件遇到这个报错后再重新启动编译就正常监听了该文件了,但是其他文件却不行,都是得在那个文件报错后再重新启动编译才正常。
尝试各种解决方案都无果,一度以为是gulpfile文件编写有错:

1 var gulp = require('gulp');
2 var sass = require('gulp-sass');
3 var minifyCSS = require('gulp-minify-css');
4 var rename = require('gulp-rename');
5 var browserSync = require('browser-sync').create();
6
7 // Static server
8 gulp.task('browser-sync', function() {
9 browserSync.init({
10 server: {
11 baseDir: './'
12 }
13 });
14 });
15
16 // Build and Reload css files
17 gulp.task('compressCSS', function() {
18 gulp.src('src/styles/**/*.scss')
19 .pipe(sass({
20 outputStyle: 'compressed'
21 }))
22 .on('error', sass.logError)
23 .pipe(minifyCSS())
24 .pipe(rename({
25 suffix: '.min'
26 }))
27 .pipe(gulp.dest('prd/styles'))
28 .pipe(browserSync.stream());
29 });
30
31
32 // Reload HTML file
33 gulp.task('reloadHTML', function() {
34 gulp.src('./index.html')
35 .pipe(browserSync.stream());
36 });
37
38 // Watch files for changes & recompile
39 gulp.task('watch', function() {
40 gulp.watch(['src/styles/**/*.scss'], ['compressCSS']);
41 gulp.watch(['./index.html'], ['reloadHTML']);
42 });
43
44 // Default task, running just `gulp` will move font, compress js and scss, start server, watch files.
45 gulp.task('default', ['compressCSS', 'browser-sync', 'watch']);

最后在https://github.com/dlmanning/gulp-sass/issues/1 找到了答案:Sublime文本和缓慢的硬盘驱动器的组合造成的。 我们能够通过将设置atomic_save更改为true来解决它。
【gulp-sass】error: File to import not found or unreadable的更多相关文章
- 【解决方法】INF file txtsetup.sif is corrupt or missing /// 使用WinSetupFromUSB来U盘安装windows2003(不使用win PE系统)
[解决方法]INF file txtsetup.sif is corrupt or missing http://blog.csdn.net/zhyl8157121/article/details/8 ...
- 【MySQL案例】error.log的Warning:If a crash happens thisconfiguration does not guarantee that the relay lo(转)
标签: 1.1.1. If a crash happens thisconfiguration does not guarantee that the relay log info will be c ...
- 【MySQL案例】error.log的Warning:If a crash happens thisconfiguration does not guarantee that the relay lo
1.1.1. If a crash happens thisconfiguration does not guarantee that the relay log info will be consi ...
- 【MySQL案件】ERROR 1665 (HY000)
转载请注明: http://blog.csdn.net/jason_asia/article/details/36240815 1.1.1. ERROR 1665 (HY000) [环境的叙述性说明] ...
- 【MySQL案件】ERROR 1418
1.1.1. ERROR 1418 [环境的叙述性说明] mysql5.0.67 [问题叙述性说明] 当它来到创建存储过程ERROR 1418一个错误. # 创建函数SQL声明 CREATE FUNC ...
- 【MySQL案例】ERROR 1786 (HY000)
1.1.1. ERROR 1786 (HY000) [环境描写叙述] msyql5.6.14 [报错信息] 运行create table ... select的时候遇到报错: db1 [test] [ ...
- 【已解决】Error running 'xxx项目' Command line is too long(idea版)
[错误] Error running 'xxx项目': Command line is too long. Shorten command line for xxx or also for Sprin ...
- 【Visual Studio】Error: forget to add '#include "stdafx.h"' to your source (转)
原文转自 http://www.cnblogs.com/qunews/articles/2200313.html [问题原因]在编译时使用了预编译头文件, [解决方法]Project-->Pro ...
- 【Visual Studio】error: /ZI”和“/Gy-”命令行选项不兼容(转)
原文转自 http://bbs.100home.net/view/4206.html [问题说明]vc6项目用vs2015打开时遇到的错误 [解决方法]项目属性->c/c++->常规-&g ...
随机推荐
- 【mongo】pymongo通过_id删除数据
来源:http://www.educity.cn/wenda/361741.html pymongo 根据 objectId _id 来删除数据想要删除数据,根据_id ,是最靠谱的,具体方法因为 _ ...
- 【XLL API 函数】xlAbort
C API 中有 15个 Excel 回调函数只能使用 Excel4.Excel4v.Excel12.Excel12v 函数调用(或间接的使用框架函数 Excel 或 Excel12f 调用).也就是 ...
- 使用按钮控制HTML5背景音乐开关
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <meta name ...
- Split()的简单的用法
1.Split分割一些简答的字符串事例: string str="aaa|bbb|ccc"; string[] list = str.Split('|'); 这是一个字符的切割,但 ...
- CountdownLatchTest
import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java ...
- 数独挑战(codevs 2924)
2924 数独挑战 时间限制: 1 s 空间限制: 1000 KB 题目等级 : 钻石 Diamond 题解 查看运行结果 题目描述 Description “芬兰数学家因卡拉,花费3 ...
- Genesis不能运行Perl编译后的脚本
我们经常会遇到Genesis2000中C-shell的脚本不能正常运行的问题,而同样的程序在其它电脑上又可以正常运行,如果你能看看Genesis后台窗口,也就是后面那个黑乎乎的窗口(所谓的小DOS窗口 ...
- ASP.NET SignalR 与 LayIM2.0 配合轻松实现Web聊天室(九) 之 用 Redis 实现用户在线离线状态消息处理(一)
前言 上一篇中简单讲解了用Redis缓存在线用户逻辑.篇幅也比较小,本篇将详细实现用户的上线下线通知.图片效果转换功能.而且,代码和开发思路都会详细介绍. 效果展示 目前有三个用户,user1,use ...
- iOS - 直播相关文章
直播相关文章 直播RTMP可用于测试的服务器地址 FFmpeg avdumpformat输出的tbn.tbc.tbr.PAR.DAR的含义 FFmpeg 3.0 计算视频时长 HLS Streamin ...
- DB2 bind on z/os
BIND and REBIND options for packages and plans There are several options you can use for binding or ...