2016-10-05 1 views
0

После обновления gulp-typescript от 2 до 3 я начал получать эти ошибки.Обновление gulp-typescript от 2 до 3 приводит к неизвестному параметру компилятора

error TS5023: Unknown compiler option '_readableState'. 
error TS5023: Unknown compiler option 'readable'. 
error TS5023: Unknown compiler option 'domain'. 
error TS5023: Unknown compiler option '_events'. 
error TS5023: Unknown compiler option '_eventsCount'. 
error TS5023: Unknown compiler option '_maxListeners'. 
error TS5023: Unknown compiler option '_writableState'. 
error TS5023: Unknown compiler option 'writable'. 
error TS5023: Unknown compiler option 'allowHalfOpen'. 
error TS5023: Unknown compiler option 'js'. 
error TS5023: Unknown compiler option 'dts'. 
error TS5024: Compiler option 'project' requires a value of type string. 

Я понятия не имею, почему. У меня нет этих параметров компилятора.

Я прошел через upgrade guide, но это не помогло.

Струны, _readableState и т.д., кажется, происходят из включенного НПМ пакета readable-stream

Это происходит на Windows 10 и машины Windows Server 2008R2.

Соответствующие части Gulpfile.js выглядит следующим образом

var gulp = require("gulp"); 
var plugins = require("gulp-load-plugins")({ lazy: false }); 

var tsProjectOptions = { 
    removeComments: false, 
    target: "ES5", 
    module: "commonjs", 
    noResolve: false, 
    noImplicitAny: false 
}; 

var tsProjectUnittests = plugins.typescript.createProject(tsProjectOptions); 

var typescriptGlob = [ 
    "./**/*.ts", "!./node_modules/**", "!./packages/**" 
]; 

gulp.task("compile-typescript", function() { 
    return gulp.src(typescriptGlob) 
     .pipe(plugins.sourcemaps.init()) 
     .pipe(plugins.typescript(tsProjectUnittests(plugins.typescript.reporter.longReporter()))) 
     .pipe(plugins.sourcemaps.write({ 
      sourceRoot: "./" 
     })) 
     .pipe(gulp.dest("./")); 
}); 

Я сообщил об этом как issue on gulp-typescript.

ответ

0

Я теперь понимаю, что я не обновляли синтаксис tsProject правильно, следующие работы

gulp.task("compile-typescript", function() { 
    return gulp.src(typescriptGlob) 
     .pipe(plugins.sourcemaps.init()) 
     .pipe(tsProjectUnittests(plugins.typescript.reporter.longReporter())) 
     .pipe(plugins.sourcemaps.write({ 
      sourceRoot: "./" 
     })) 
     .pipe(gulp.dest("./")); 
}); 
Смежные вопросы