2016-11-19 101 views
0

前段時間,我已經用Zurb Foundation(sass)啓動了一個Laravel 5.3項目。我配置了gulpfile.js來編譯我的sass和它正常工作直到今天停止編譯。 它在幾天前運作。 我沒碰代碼或升級之間的任何東西......SASS停止編譯:要導入的文件未找到或不可讀:util/util

錯誤:

MBP-Nicolas:v1 nicolas$ gulp 
[15:50:09] Using gulpfile ~/Documents/Developpement/PHP/Laravel/Project/v1/gulpfile.js 
[15:50:09] Starting 'default'... 
[15:50:09] Starting 'sass'... 

Fetching Sass Source Files... 
    - resources/assets/sass/app.scss 


Saving To... 
    - public/css/app.css 

[15:50:11] Finished 'default' after 1.31 s 
[15:50:11] gulp-notify: [Laravel Elixir] Sass Compilation Failed: resources/assets/sass/_settings.scss 
Error: File to import not found or unreadable: util/util 
     Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss 
     on line 43 of resources/assets/sass/_settings.scss 
>> @import 'util/util'; 
^

{ [Error: resources/assets/sass/_settings.scss 
Error: File to import not found or unreadable: util/util 
     Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss 
     on line 43 of resources/assets/sass/_settings.scss 
>> @import 'util/util'; 
^
] 
    status: 1, 
    file: '/Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss', 
    line: 43, 
    column: 1, 
    message: 'resources/assets/sass/_settings.scss\nError: File to import not found or unreadable: util/util\n  Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n  on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n', 
    formatted: 'Error: File to import not found or unreadable: util/util\n  Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n  on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n', 
    messageFormatted: '\u001b[4mresources/assets/sass/_settings.scss\u001b[24m\nError: File to import not found or unreadable: util/util\n  Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n  on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n', 
    messageOriginal: 'File to import not found or unreadable: util/util\nParent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss', 
    relativePath: 'resources/assets/sass/_settings.scss', 
    name: 'Error', 
    stack: 'Error: resources/assets/sass/_settings.scss\nError: File to import not found or unreadable: util/util\n  Parent style sheet: /Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/resources/assets/sass/_settings.scss\n  on line 43 of resources/assets/sass/_settings.scss\n>> @import \'util/util\';\n ^\n\n at options.error (/Users/nicolas/Documents/Developpement/PHP/Laravel/Project/v1/node_modules/node-sass/lib/index.js:292:26)', 
    showStack: false, 
    showProperties: true, 
    plugin: 'gulp-sass' } 
[15:50:11] Finished 'sass' after 1.38 s 
[15:50:11] Starting 'copy'... 

Fetching Copy Source Files... 
    - node_modules/font-awesome/fonts/**/* 


Saving To... 
    - public/fonts 

[15:50:11] Finished 'copy' after 55 ms 
[15:50:11] Starting 'styles'... 

Fetching Styles Source Files... 
    - node_modules/font-awesome/css/font-awesome.min.css 
    - public/css/app.css 


Saving To... 
    - public/css/all.css 

[15:50:11] gulp-notify: [Laravel Elixir] Stylesheets Merged! 
[15:50:11] Finished 'styles' after 95 ms 
[15:50:11] Starting 'scripts'... 

Fetching Scripts Source Files... 
    - node_modules/jquery/dist/jquery.js 
    - node_modules/foundation-sites/dist/foundation.min.js 
    - resources/assets/js/main.js 


Saving To... 
    - public/js/all.js 

[15:50:12] gulp-notify: [Laravel Elixir] Scripts Merged! 
[15:50:12] Finished 'scripts' after 1.3 s 

我真的不知道你需要些什麼,但這裏是我的gulpfile:

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

elixir(function(mix) { 

    //Compilation SASS 
    mix.sass('app.scss', null, null, { includePaths: ['node_modules/foundation-sites/scss'] }); 

    //Copy of fonts 
    mix.copy('node_modules/font-awesome/fonts', 'public/fonts'); 

    //Compilation CSS 
    mix.styles([ 
     '../../../node_modules/font-awesome/css/font-awesome.min.css', 
     '../../../public/css/app.css' 
    ]); 

    //Compilation JavaScript 
    var JSJquery = '../../../node_modules/jquery/dist/jquery.js'; 
    var JSFoundation = '../../../node_modules/foundation-sites/dist/foundation.min.js'; 

    mix.scripts([ 
     JSJquery, 
     /*JSFoundation + 'foundation.core.js', 
     JSFoundation + 'foundation.util.keyboard.js', 
     JSFoundation + 'foundation.util.box.js', 
     JSFoundation + 'foundation.util.triggers.js', 
     JSFoundation + 'foundation.util.mediaQuery.js', 
     JSFoundation + 'foundation.util.motion.js', 
     JSFoundation + 'foundation.reveal.js', 
     JSFoundation + 'foundation.offcanvas.js',*/ 
     JSFoundation, 
     'main.js' 
    ]); 

}); 

_settings.scss的第43行是@import 'util/util';。 如果它是有用的,這些工具的一些版本:

  1. 節點-v:v4.6.0
  2. NPM -v:2.15.9
  3. 青菜-v:薩斯3.4.15(選擇性 史蒂夫)

但就像我說的,我不記得升級任何它。

感謝您的幫助。

回答

1

根據你吞掉文件和文件SASS你應該在的位置有你util.scss文件「node_modules /基礎的網站/ SCSS/UTIL/util.scss」這是因爲你在你大口文件中的以下

mix.sass('app.scss', null, null, { includePaths: ['node_modules/foundation-sites/scss'] }); 

,並在您設置以下文件

util/util 

確保文件是在該位置,如果不是,請修改gulpfile或設置相應文件。

編輯:你可以從你的gulp文件發佈你的'sass'任務,這可能有幫助嗎?

+0

您好,感謝您的回覆。該文件的位置是正確的,請參閱圖像:http://img11.hostingpics.net/pics/784570util.png –

+0

'sass任務'是什麼意思? –

+0

在你的gulpfile.js中,你應該有一個名爲sass的gulp任務。像這樣的東西......'gulp.task('sass',function(){...});'。如果您粘貼內容,它將有助於排除故障。 – Davey

相關問題