Typings / node / node.d.ts (259,26): error TS2304: Cannot find name 'DataView'

I know there are various problems opening up about this, I just don't understand where my problem is. I suspect there is some version out there, but I don't know where or what the "best practice" is here.

Here is the code:

converter.ts:

/// <reference path="typings/node/node.d.ts" />

import fs = require('fs');

interface Question {
    number: number;
    text: string;
}

interface Answers {
    ordinal: number;
    text: string;
}

      

tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs", 
        "outDir": "built/", 
        "sourceMap": true, 
        "target": "es5"
    }, 
    "files": [
        "converter.ts"
    ]
}

      

shell:

csvproc> tsc -v
message TS6029: Version 1.5.0-beta

csvproc> tsd -V
>> tsd 0.6.3

csvproc> tsc
typings/node/node.d.ts(259,26): error TS2304: Cannot find name 'DataView'.
typings/node/node.d.ts(273,21): error TS2304: Cannot find name 'Map'.
typings/node/node.d.ts(282,21): error TS2304: Cannot find name 'Set'.
typings/node/node.d.ts(292,25): error TS2304: Cannot find name 'WeakMap'.
csvproc>

      

+3


source to share


2 answers


The name "DataView" could not be found.

current node.d.ts on main is not TypeScript 1.5 compatible



This works: https://github.com/Microsoft/TypeScript/issues/3211 <question you can follow.

+2


source


As noted above in basarat, the current node.d.ts is incompatible. In the meantime, you can change your tsd.json to use sha "7bab855ae33d79e86da1eb6c73a7f7eab2676ddb". This previous version of the node interface works fine with 1.5. After changing the sha in the file, just delete the typings / directory and run tsd reinstall -s

.



+3


source







All Articles