首页 \ 问答 \ Gulp.js TypeError:需要使用glob模式字符串(Gulp.js TypeError: glob pattern string required)

Gulp.js TypeError:需要使用glob模式字符串(Gulp.js TypeError: glob pattern string required)

我正在按照这个教程在Ubuntu上设置gulp.js。 但是,当我在终端运行gulp styles ,出现'TypeError:glob pattern string required'错误。 我是一个完整的吞咽小吃 - 任何人都可以指向正确的方向吗?

我的gulpfile.js文件:

var gulp = require('gulp'),
    sass = require('gulp-ruby-sass'),
    autoprefixer = require('gulp-autoprefixer'),
    minifycss = require('gulp-minify-css'),
    rename = require('gulp-rename');

gulp.task('styles', function() {
  return gulp.src('sass/*.scss')
    .pipe(sass({ style: 'expanded' }))
    .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
    .pipe(gulp.dest('css'))
    .pipe(rename({suffix: '.min'}))
    .pipe(minifycss())
    .pipe(gulp.dest('css'));
});

我的文件目录:

文件路径

编辑:

我在我的gulp.js文件中试过这个:

gulp.task('styles', function () {
    return sass('sass/*.scss', {
      style: 'expanded'
    })
    .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
    .pipe(gulp.dest('css'))
    .pipe(rename({suffix: '.min'}))
    .pipe(minifycss())
    .pipe(gulp.dest('css'));
});

并收到此错误输出:

在这里输入图像描述

我的语法错了吗?


I'm following this tutorial to set up gulp.js on Ubuntu. However, when I run gulp styles in the terminal I get the 'TypeError: glob pattern string required' error. I'm a complete gulp noob - could anyone point me in the right direction?

My gulpfile.js file:

var gulp = require('gulp'),
    sass = require('gulp-ruby-sass'),
    autoprefixer = require('gulp-autoprefixer'),
    minifycss = require('gulp-minify-css'),
    rename = require('gulp-rename');

gulp.task('styles', function() {
  return gulp.src('sass/*.scss')
    .pipe(sass({ style: 'expanded' }))
    .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
    .pipe(gulp.dest('css'))
    .pipe(rename({suffix: '.min'}))
    .pipe(minifycss())
    .pipe(gulp.dest('css'));
});

My file directory:

file pathing

Edit:

I tried this in my gulp.js file:

gulp.task('styles', function () {
    return sass('sass/*.scss', {
      style: 'expanded'
    })
    .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))
    .pipe(gulp.dest('css'))
    .pipe(rename({suffix: '.min'}))
    .pipe(minifycss())
    .pipe(gulp.dest('css'));
});

and received this error output:

enter image description here

Is my syntax wrong?


原文:https://stackoverflow.com/questions/34629296
更新时间:2023-12-22 20:12

最满意答案

谢谢。 我发现了问题发生的原因。 问题是$ mail-> addAttachment('logo.png','logoimage')。 我改为$ mail-> embedImage('logo.png','logoimage','logo.png')瞧! 有效。

所以addAttachment只被识别为附件,但是webmail仍然会读取它,但雅虎不会


thanks. I've found out why the problem occurred. the problem is $mail->addAttachment('logo.png', 'logoimage'). I changed to $mail->embedImage('logo.png', 'logoimage', 'logo.png') voila! it worked.

so the addAttachment is recognized only as an attachment but webmail still reads it but yahoo wouldnt

相关问答

更多
  • 而不是直接选择mid,选择messageInfo.mid将修复它 下面的查询做了魔术:从ymail.msgcontent中选择消息,其中(mids)在(从ymail.messages中选择messageInfo.mid,其中messageInfo.receivedDate> 1392658116) Instead of directly selecting mid, select messageInfo.mid will fix it Below query did the magic : select m ...
  • 所有大型邮件端点都维护着生成过多电子邮件的发件人的动态黑名单。 有些人使用“每分钟邮件”,有些人使用“24小时内的邮件总数”。 我和一些英国邮件终端有相同的经验(你会发现BT和PlusNet - 两个英国互联网服务提供商 - 会给你类似的'问题') 确保您不被视为垃圾邮件生成器(实际上是您)的唯一方法是与运行端点的特定公司打开一个对话框,并说服他们您没有生成商业垃圾邮件。 除非您是一家大公司,并且拥有合理的市场声誉,否则您无法做到这一点。 鉴于这些电子邮件提供商承诺阻止其客户收到未经请求的电子邮件(垃圾邮件 ...
  • 如果您的服务器上安装了qmail,请尝试使用它。 或者,有一个很好的PHP邮件程序类,名为swiftmail,可以在这里找到: http ://swiftmailer.org/你可以试试。 您的电子邮件可能被垃圾/标记为垃圾邮件。 If you have qmail installed on your server, try using that. Alternatively, there is a nice PHP mailer class called swiftmail that is availab ...
  • 我终于在脸上露出了笑容。 与@DaveRandom一起工作,他帮我提出了这些代码: 注意:下面的代码使用PHPMailer
  • 谢谢。 我发现了问题发生的原因。 问题是$ mail-> addAttachment('logo.png','logoimage')。 我改为$ mail-> embedImage('logo.png','logoimage','logo.png')瞧! 有效。 所以addAttachment只被识别为附件,但是webmail仍然会读取它,但雅虎不会 thanks. I've found out why the problem occurred. the problem is $mail->addAttac ...
  • 在标签中使用iframe。 您很快就会发现很难正确调整大小并且我发现在IE中不起作用(至少版本8及以下版本)。 最好的方法是在....之间构建a.jsf和b.jsf的代码因为无论如何它们都是JSF,所以应该不难。 您可以使用tabview的动态属性来帮助提高页面加载性能。 Use an iframe in the tab. You'll soon find that it's difficult to size properly and I found doesn't work ...
  • 在某些服务器上上传图像,然后将其链接到您的代码,这将无法正常工作 logo 试试这个 logo The problem was yahoo mail using my media queries, cause yahoo dont know the syntax of media querie ...
  • 您可以在大多数现代浏览器中设置窗体元素的样式,最简单的方法是使用jQuery: http : //www.jquery.com 有一些插件样式表单元素,并添加“全部检查”功能。 You can style form elements in most modern browsers, the easiest way to do it might be with jQuery: http://www.jquery.com There are some plugins that style form elemen ...
  • 我刚刚解决了......似乎我必须用'http://'来写完整的链接我不知道为什么只有雅虎需要这种格式。 它与gmail和hotmail一起工作正常。 I just solved it... it seems that i must write the complete link with the 'http://' I dunno why only yahoo needs this format. it was working fine with gmail and hotmail.
  • 你使用什么协议? 我知道Gmail支持IMAP,所以我认为这就是你在那里使用的。 雅虎? 如果它们仅支持POP3,则标志将不起作用,因为POP3不支持标志。 尝试看看Folder.getPermanentFlags()返回的内容。 What protocols are you using? I know Gmail supports IMAP so I assume that is what you are using there. Does Yahoo? If they only support POP3 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)