Gulp错误:路径必须是字符串 [英] Gulp error: Path must be a string

查看:262
本文介绍了Gulp错误:路径必须是字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



$ b

重现步骤:

  $ composer global requirelaravel / installer =〜1.1
$ laravel new myproject
$ cd myproject
$ php artisan serve
$ npm install
$ npm rm bootstrap-sass -save
$ npm install foundation-sites -save
$ npm install motion-ui -save

然后我复制

  _settings.scss 

code>

from

  node_modules /基金会网站/ scss /设置

  resources / assets / sass 

在app.scss中我把每一个基金会的进口都放进去了,最后我写下了Elixir的任务,就像这里报道的那样:

http://zecipriano.com/zh/2015/12/laravel-elixir -and-zurb基金会 - 重访

但是当我从终端启动gulp时:

  path.js:7 
抛出新的TypeError('路径必须是一个字符串。收到'+检查(路径));

...不知道该怎么做。



一切都已更新,所以我认为这不是一个版本问题。





  $ node -v 

v6.8.0

以下是我的gulpfile.js:

const elixir = require('laravel-elixir'); require('laravel-elixir-vue-2'); / * | -------------------- -------------------------------------------------- ---- | Elixir资产管理| ---------------------------------------------- ---------------------------- | | Elixir提供了一个干净流畅的API来定义一些基本的Gulp任务|为您的Laravel应用程序。默认情况下,我们正在编译Sass |我们的应用程序文件,以及发布供应商资源。 | * / elixir(function(mix){// Sass var options = {includePaths:['node_modules / foundation-sites / scss','node_modules / motion-ui / src']}; mix.sass('app.scss' ,null,options); // Javascript var jQuery ='../../../node_modules/jquery/dist/jquery.js'; var foundationJsFolder ='../../../node_modules/foundation- sites / js /'; mix.scripts([jQuery,foundationJsFolder +'foundation.core.js',//在这里包含任何需要的组件,下面只是一些例子,foundationJsFolder +'foundation.util.mediaquery.js',foundationJsFolder +'foundation.util.keyboard.js',foundationJsFolder +'foundation.util.timerAndImageLoader.js',foundationJsFolder +'foundation.tabs.js',//这个文件初始化基础'start_foundation.js']);});



有什么想法?

预先感谢您。


问题是选项已从第三个参数移动到第四个参数。你可以运行它:

  mix.sass('app.scss',null,null,options); 

干杯:D


I've got a problem with gulp.js.

Steps to reproduce:

$ composer global require "laravel/installer=~1.1"
$ laravel new myproject
$ cd myproject
$ php artisan serve 
$ npm install
$ npm rm bootstrap-sass —save
$ npm install foundation-sites —save
$ npm install motion-ui —save

then I copy

_settings.scss 

from

node_modules/foundation-sites/scss/settings 

to

resources/assets/sass

in app.scss then i put every Foundation import

and finally I write Elixir task as reported here:

http://zecipriano.com/en/2015/12/laravel-elixir-and-zurb-foundation-revisited/

But when I launch gulp from terminal:

 path.js:7
  throw new TypeError('Path must be a string. Received ' + inspect(path));

... don't know what to do.

Everything updated, so I think it's not a version problem.

[EDIT]

$ node -v

v6.8.0

and here's my gulpfile.js:

const elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {

    // Sass
    var options = {
        includePaths: [
            'node_modules/foundation-sites/scss',
            'node_modules/motion-ui/src'
        ]
    };

    mix.sass('app.scss', null, options);

    // Javascript
    var jQuery = '../../../node_modules/jquery/dist/jquery.js';
    var foundationJsFolder = '../../../node_modules/foundation-sites/js/';

    mix.scripts([
       jQuery,
       foundationJsFolder + 'foundation.core.js',
       // Include any needed components here. The following are just examples.
       foundationJsFolder + 'foundation.util.mediaquery.js',
       foundationJsFolder + 'foundation.util.keyboard.js',
       foundationJsFolder + 'foundation.util.timerAndImageLoader.js',
       foundationJsFolder + 'foundation.tabs.js',
       // This file initializes foundation
       'start_foundation.js'
    ]);

});

Any ideas?

Thank you in advance.

解决方案

The problem is that the options have been moved from the third to the fourth parameter. You can run it with:

   mix.sass('app.scss', null, null, options);

Cheers :D

这篇关于Gulp错误:路径必须是字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆