使用gulp 编译 typescript ,
var gulp = require('gulp'),
tslint = require('gulp-tslint')
console.log(tslint)
gulp.task('lint', function () {
return gulp.src([
'./source/ts/**/**/**.ts',
'./test/**/**.test.ts'
]).pipe(tslint())
.pipe(tslint.report('verbose'))
})
gulp.task('default', ['lint'], function () {
console.log('242342')
})
执行报错:
Cannot find module 'typescript'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\M-Ray\Desktop\typescript\node_modules\tslint\lib\linter.js:20:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
其实我都已经全局安装了typescript 和gulp-typescript 了
白衣染霜花
相关分类