2015-11-26 134 views
0

隨着laravel-elixir-compass(和gulpfile.jsREADME.md),它說:如何在laravel中使用指南針?

$ gulp 
module.js:340 
    throw err; 
    ^

Error: Cannot find module 'laravel-elixir/ingredients/helpers/utilities' 
    at Function.Module._resolveFilename (module.js:338:15) 
    at Function.Module._load (module.js:289:25) 
    at Module.require (module.js:366:17) 
    at require (module.js:385:17) 
    at Object.<anonymous> (/srv/http/sl/node_modules/laravel-elixir-compass/index.js:4:17) 
    at Module._compile (module.js:425:26) 
    at Object.Module._extensions..js (module.js:432:10) 
    at Module.load (module.js:356:32) 
    at Function.Module._load (module.js:313:12) 
    at Module.require (module.js:366:17) 
    at require (module.js:385:17) 

所以,我斷定它依賴於elixir <= 0.9.1,因爲this是當這個文件被改名。而this是我能找到的碰撞版本中最接近的提交。

然後我注意到「項目已移動」警告README.md

隨着laravel-elixir-sass-compass(和gulpfile.jsREADME.md):

$ gulp 
[00:19:03] Using gulpfile /srv/http/sl/gulpfile.js 
[00:19:03] Starting 'default'... 
[00:19:03] Starting 'compass'... 
[00:19:03] 'compass' errored after 985 μs 
[00:19:03] TypeError: Cannot read property 'indexOf' of undefined 
    at prefixOne (/srv/http/sl/node_modules/laravel-elixir/GulpPaths.js:104:17) 
    at GulpPaths.prefix (/srv/http/sl/node_modules/laravel-elixir/GulpPaths.js:124:12) 
    at GulpPaths.src (/srv/http/sl/node_modules/laravel-elixir/GulpPaths.js:24:16) 
    at prepGulpPaths (/srv/http/sl/node_modules/laravel-elixir-sass-compass/index.js:46:14) 
    at null.definition (/srv/http/sl/node_modules/laravel-elixir-sass-compass/index.js:31:21) 
    at Task.run (/srv/http/sl/node_modules/laravel-elixir/Task.js:96:17) 
    at Gulp.<anonymous> (/srv/http/sl/node_modules/laravel-elixir/index.js:94:52) 
    at module.exports (/srv/http/sl/node_modules/orchestrator/lib/runTask.js:34:7) 
    at Gulp.Orchestrator._runTask (/srv/http/sl/node_modules/orchestrator/index.js:273:3) 
    at Gulp.Orchestrator._runStep (/srv/http/sl/node_modules/orchestrator/index.js:214:10) 
[00:19:03] Error in plugin 'run-sequence' 
Message: 
    An error occured in task 'compass'. 
[00:19:03] Finished 'default' after 9.56 ms 

隨着(mix.compass('app.sass'))通過任何路徑:

$ gulp 
[00:20:40] Using gulpfile /srv/http/sl/gulpfile.js 
[00:20:40] Starting 'default'... 
[00:20:40] Starting 'compass'... 
[00:20:40] Finished 'default' after 14 ms 
[00:20:40] Nothing to compile. If you're trying to start a new project, you have left off the directory argument. 
Run "compass -h" to get help. 

[00:20:40] gulp-notify: [Laravel Elixir] Compass Compilation Failed!: Compass failed 
{ [Error: Compass failed] 
    message: 'Compass failed', 
    showStack: false, 
    showProperties: true, 
    plugin: 'gulp-compass', 
    __safety: { toString: [Function: bound ] } } 
[00:20:40] 'compass' errored after 414 ms 
[00:20:40] Error in plugin 'gulp-compass' 
Message: 
    Compass failed 
[00:20:40] Error in plugin 'run-sequence' 
Message: 
    An error occured in task 'compass'. 
+0

您選擇的Elixir標籤適用於BEAM編程語言。刪除這個標籤。 –

回答

0

當它出現時,它只是不能找到任何文件進行編譯。所以,gulpfile.js基本版本是要像這樣:

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

require('laravel-elixir-sass-compass'); 

elixir(function(mix) { 
    mix.compass('*', 'public/css', { 
     sass: 'resources/assets/sass' 
    }); 
}); 

這裏的relevant issue