2016-03-04 25 views
-1

這是我gulpfile.js的內容:奧裏利亞打捆gulp.js無法找到

var gulp = require('gulp'); 
var bundler = require('aurelia-bundler'); 

var config = { 
    force: true, 
    packagePath: '.', 
    bundles: { 
    "dist/app-build": { 
     includes: [ 
     'Main.js', 
     ], 
     excludes:[ 
      "gulpfile.js", 
     ], 
     options: { 
     inject: true, 
     minify: true 
     } 
    }, 
    "dist/aurelia": { 
     includes: [ 
     'aurelia-bootstrapper', 
     'aurelia-fetch-client', 
     'aurelia-router', 
     'aurelia-animator-css', 
     'github:aurelia/templating-binding', 
     'github:aurelia/templating-resources', 
     'github:aurelia/templating-router', 
     'github:aurelia/loader-default', 
     'github:aurelia/history-browser', 
     'github:aurelia/logging-console' 
     ], 
     options: { 
     inject: true, 
     minify: true 
     } 
    } 
    } 
}; 

gulp.task('bundle', function() { 
    console.log("ok"); 
return bundler.bundle(config); 
}); 

當我運行一飲而盡捆綁出現下列錯誤:

[08:08:54] 'bundle' errored after 536 ms [08:08:54] Error on fetch for gulp.js at file:///C:/myapp/gulp.js Loading gulpfile.js Error: ENOENT: no such file or directory, open 'C:\myapp\gulp.js' at Error (native)

我wounder他爲什麼要在項目的根目錄中搜索gulp.js,而不是在node_modules文件夾中搜索?

回答

0

這個文件做的第一件事就是試圖要求'吞噬' - 你先做了一個npm install

-1

最後,我通過刪除node_modules文件夾並再次運行npm install來解決問題