Gulp错误:路径必须是字符串 [英] Gulp error: Path must be a string
本文介绍了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的任务,就像这里报道的那样:
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屋!
查看全文