2015-09-25 181 views
1

這裏是我的gulpfile.jsGULP找不到模塊

var gulp = require("gulp"), 
    traceur = require("traceur"), 
    babel = require("babel"), 
    plumber = require("plumber"), 
    es6Path = "es6/*.js", 
    compilePath = "es6/compiled"; 

gulp.task("traceur", function() { 
    gulp.src([ es6Path ]) 
     .pipe(plumber()) 
     .pipe(traceur({ blockBinding: true })) 
     .pipe(gulp.dest(compilePath + '/traceur')); 
}); 

gulp.task("babel", function() { 
    gulp.src([ es6Path ]) 
     .pipe(plumber()) 
     .pipe(babel()) 
     .pipe(gulp.dest(compilePath + '/babel')); 
}); 

gulp.task("watch", function() { 
    gulp.watch([ es6Path ], [ "traceur", "babel" ]); 
}); 

gulp.task("default", [ "traceur", "babel", "watch" ]); 

這是我的package.json文件。

{ 
    "name": "ES6Demos", 
    "version": "1.0.0", 
    "description": "Getting started wtih ES6 using gulp", 
    "main": "index.js", 
    "scripts": { 
    "test": "echo \"Error: no test specified\" && exit 1" 
    }, 
    "author": "Vinayak Phal", 
    "license": "ISC", 
    "devDependencies": { 
    "gulp": "^3.9.0", 
    "gulp-babel": "^5.2.1", 
    "gulp-concat": "^2.6.0", 
    "gulp-plumber": "^1.0.1", 
    "gulp-traceur": "^0.17.1", 
    "gulp-typescript": "^2.9.0", 
    "gulp-uglify": "^1.4.1" 
    } 
} 

安裝了所有的依賴和一切,但我仍然收到以下錯誤。

這不僅跟蹤跟蹤,它也給其他模塊的錯誤。 以吞嚥者爲準。

enter image description here

回答

1

你需要 「traceur」。你需要要求「吞食 - 追蹤」。對於其他軟件包也是如此。

+0

非常感謝你......這是我犯的一個愚蠢的錯誤...... – Vins