Typescript를 사용하고 있습니다. fs 사용에 문제가 있습니다.Typescript : 시작 문제 (모듈 fs를 찾을 수없고 이름 입력을 찾을 수 없음)
다음 코드는 Ingest.ts(4,21): error TS2307: Cannot find module 'fs'
입니다.
// <reference path="typings/node/node.d.ts"/>
'use strict';
import * as fs from "fs";
console.log("hi matt");
var data = fs.readFileSync('matt.txt');
console.log(data);
나는 ///보다는 첫 번째 라인을 변경하는 경우
나는이 오류가 // : 나는 다음 단계했던 이러한 시도에typings/node/node.d.ts(512,16): error TS2304: Cannot find name 'IterableIterator'.
typings/node/node.d.ts(514,13): error TS2304: Cannot find name 'IterableIterator'.
typings/node/node.d.ts(515,15): error TS2304: Cannot find name 'IterableIterator'.
이전 :
을npm install -g typescript
npm install -g [email protected]
cd <project folder>
tsd install node
tsc -init
tsc Ingest.ts
OSX 용 노드 v.6.4.0 및 tsc v.1.8.10 요세미티
DefinitelyTyped GitHub의 문제가 여기에 있습니다 : https://github.com/DefinitelyTyped/DefinitelyTyped/issues/10919 – cartant
내 나쁜, 내가 포함해야하는 내가 연 이후 LOL –