2

我正在使用 Laravel 5,我想使用 sass。我将 gulpfile.js 从 less 更改为 sass。

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

/*
 |--------------------------------------------------------------------------
 | 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 Less
 | file for our application, as well as publishing vendor resources.
 |
 */

elixir(function(mix) {
  mix.sass('app.scss')
     .coffee();
});

但是,当我运行时gulp watch,它失败了。

[take@take]% gulp watch 
[18:24:45] Using gulpfile ~/Sites/myapp/gulpfile.js
[18:24:45] Starting 'watch'...
[18:24:45] Starting 'sass'...
[18:24:45] 'sass' errored after 10 ms
[18:24:45] Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/take/Sites/myapp/node_modules/laravel-elixir/node_modules/gulp-sass/node_modules/node-sass/lib/index.js:211:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
Error running task sequence: { task: 'sass',
  message: 'sass catch',
  duration: 0.010338111,
  hrDuration: [ 0, 10338111 ],
  err: [Error: Module did not self-register.] }
[18:24:45] Finished 'watch' after 17 ms

node -vv0.12.0

4

2 回答 2

0

我是节点版本的问题。 https://github.com/dlmmanning/gulp-sass/issues/152

我降级到节点 v0.10.36,然后gulp watch运行良好。

于 2015-02-12T09:41:06.857 回答
0

我做了

sudo npm update

它对我有用。

于 2015-06-17T16:39:20.657 回答