Typescript error while creating nodeJs
I am really trying to develop an application with nodejs and typescript and I am running into a problem while compiling tsc.
I got this error when running my code (it seems the external module cannot be loaded):
[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 is 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 is the code that doesn't want to compile and throw me an exception:
/// <reference path="../typings/glob/glob.d.ts" />
import glob = require('glob');
console.log("zfazf");
What's wrong with this piece of code?
Thanks for the promotion
+3
source to share
1 answer
What's wrong with this piece of code
Nothing. You need to get the definition files node.d.ts
from the beta branch manually prior to release: https://github.com/borisyankov/DefinitelyTyped/issues/4249
+3
source to share