Reputation: 8922
I m actually trying to developp an application with nodejs and typescript and I m facing a problem at tsc compilation.
I got this error when running my code (it seems that the external module cannot be load) :
[09:20:29] Compiling TypeScript files using tsc version 1.5.0
[09:20:30] Compiling TypeScript files using tsc version 1.5.0
[09:20:30] [tsc] > F:/SkeletonProject/typings/node/node.d.ts(198,26): error TS2304: Cannot find name 'DataView'.
[09:20:30] [tsc] > F:/SkeletonProject/typings/node/node.d.ts(212,21): error TS2304: Cannot find name 'Map'.
[09:20:30] [tsc] > F:/SkeletonProject/typings/node/node.d.ts(221,21): error TS2304: Cannot find name 'Set'.
[09:20:30] [tsc] > F:/SkeletonProject/typings/node/node.d.ts(231,25): error TS2304: Cannot find name 'WeakMap'.
Here's my gulpfile :
var gulp = require('gulp');
var typescript = require('gulp-tsc');
gulp.task('boot', ['compileBoot'], function () {
return gulp.src(['./app/src/**/*.ts'])
.pipe(typescript())
.pipe(gulp.dest('./app/dist/'))
});
gulp.task('compileBoot', ['compileApp'], function () {
return gulp.src(['./boot/**/*.ts'])
.pipe(typescript())
.pipe(gulp.dest('./boot'))
});
gulp.task('compileApp', function () {
return gulp.src(['./app/src/**/*.ts'])
.pipe(typescript())
.pipe(gulp.dest('./app/dist/'))
});
gulp.start('boot');
And here's the code that doesn't want to compile and throw me the exception :
/// <reference path="../typings/glob/glob.d.ts" />
import glob = require('glob');
console.log("zfazf");
What is wrong in this piece of code ?
Thanks for advance
Upvotes: 3
Views: 3191
Reputation: 276161
What is wrong in this piece of code
Nothing. You need to get the definition files node.d.ts
from the beta branch manually till it is released : https://github.com/borisyankov/DefinitelyTyped/issues/4249
Upvotes: 3