Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp error: Path must be a string

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.

like image 876
Yuri Refolo Avatar asked Apr 22 '26 17:04

Yuri Refolo


1 Answers

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

like image 57
Marco Avatar answered Apr 25 '26 09:04

Marco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!