1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
error TS2468: Cannot find global value 'Promise'.
/main.ts(2,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
/main.ts(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
/mainJs.js(2,1): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
!!! error TS2468: Cannot find global value 'Promise'.
==== /node_modules/@types/node/index.d.ts (0 errors) ====
declare var require: (...args: any[]) => any;
==== /ambient.d.ts (0 errors) ====
declare module "fs" {
export function readFileSync(path: string, encoding?: string): string;
}
declare module "path" {
import fs = require("fs"); // ok
namespace path {
export const sep: string;
}
export = path; // ok
}
==== /mainJs.js (1 errors) ====
import {} from "./a";
import("./a");
~~~~~~~~~~~~~
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
const _ = require("./a"); // No resolution
_.a; // any
==== /main.ts (2 errors) ====
import {} from "./a";
import _ = require("./a"); // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
export = {}; // Error
~~~~~~~~~~~~
!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.
export {};
==== /a.ts (0 errors) ====
export const a = "a";
|