从几天开始,我无法使用laravel elixir编译sass,并将其版本化。当我运行gulp
时,它会显示以下错误消息:
$ gulp
[18:46:11] Using gulpfile /srv/http/xxx/gulpfile.js
[18:46:11] Starting 'default'...
[18:46:11] Starting 'sass'...
[18:46:11] 'sass' errored after 11 ms
[18:46:11] 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> (/srv/http/xxx/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.011248177,
hrDuration: [ 0, 11248177 ],
err: [Error: Module did not self-register.] }
[18:46:11] Finished 'default' after 18 ms
程序版本:
$ gulp -v
[18:51:19] CLI version 3.8.11
[18:51:19] Local version 3.8.11
$ node -v
v0.12.0
的package.json:
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8",
"laravel-elixir": "*"
}
}
gulpfile.js
elixir(function(mix) {
mix.sass()
.stylesIn('public/css')
.version('css/all.css');
}
我该怎么做才能解决这个问题?
答案 0 :(得分:1)
这似乎是gulp-sass
的一个问题,它是对elixir的依赖https://github.com/dlmanning/gulp-sass/issues/152
您有两种选择之一:
v0.12.0
并安装npm v0.10.0
node_modules
文件夹并再次运行npm install