3

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

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your help, actually looking into the issues to fix my problem
It seems that I already use the latest version of the node.d.ts (from 1.5 alpha) and it doesn't change anything :-/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.