【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 ...
随机推荐
- CSS3实现圆角效果
利用border-radius属性可以给元素div,input元素等添加圆角效果 后跟 值为这个圆角的半径,即数值越大效果越明显 -webkit-border-top/bottom-left/righ ...
- 【processing】小代码4
translate(x,y); 移动坐标原点到x,y处 rotate(angle); 坐标沿原点顺时针转动angle度 scale(n); 绘制图像放大n倍 pushMatrix() 将当前坐标压入 ...
- window.parent与window.openner区别介绍
今天总结一下js中几个对象的区别和用法: 首先来说说 parent.window与top.window的用法 "window.location.href"."locati ...
- JS倒计时,不会重复执行
直接上代码,亲自测试了的,没问题咯 <html> <head> <title>点击获取验证码按钮后按钮变灰,倒计时一段时间后又可重复点击</title> ...
- .Net如何在后台设置日期格式,并显示在前台页面上
其实方法比较老咯,有比这个简单的朋友请留言哈,我的思路是先将数据库中的日期格式读出来,在后台转化成DatetTime类型,然后在使用DateTime的内部方法设置日期格式,代码如下: DateTime ...
- Java之POJO
转: POJO 一:什么是POJOPOJO的名称有多种,pure old java object .plain ordinary java object 等.按照Martin Fowler的解释 ...
- Mac系统下使用VirtualBox虚拟机安装win7--第三步 在虚拟机上安装 Windows 7
第三步 在虚拟机上安装 Windows 7 等待虚拟机进入 Windows 7 的安装界面以后,在语言,货币,键盘输入法这一面,建议保持默认设置,直接点击“下一步”按钮,如图所示
- CLR via C#(17)--接口
CLR不允许继承多个基类,但是可以继承多个接口.凡是能使用具名接口类型的实例的地方,都能使用实现了接口的一个类型的实例. 接口是对一组方法签名进行了统一命名,但不提供任何实现,而具体类则必须为继承的全 ...
- Asp.Net - 7.AJAX
AJAX简介 没有AJAX会怎么样?普通的ASP.Net每次执行服务端方法的时候都要刷新当前页面,比如实现显示服务器的时间.每次都要刷新面的坏处:页面刷新打断用户操作.速度慢.增加服务器的流量压力.如 ...
- VS2010 自动跳过代码现象
今日,发现在Release的调试模式下,VS2010会“莫名其妙”的跳过一些代码不执行. 经实验,初步判断可能的原因:预处理器指令或编译器/连接器优化. 20150703更新: 部分代码: m_pTa ...