-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
OS?
Windows 10 x64
Versions.
ng 2.4.4
nodejs 6.9.2
Repro steps.
main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
import {enableProdMode} from '@angular/core';
if (global['node_env'] !== 'development') {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2015",
"dom"
],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
},
"files": [
"src/angular/app/app.module.ts",
"src/angular/app/main.ts"
],
"angularCompilerOptions": {
"genDir": "aot",
"skipMetadataEmit": true
},
"compileOnSave": false,
"exclude": [
"node_modules",
"backup",
"output"
]
}
The log given by the failure.
Normally this include a stack trace and some more information.
ERROR in ./src/angular/app/main.ts
Module build failed: Error: D:/work/nodejs/keypos/aot/src/angular/app/main.ts (4,5): Cannot find name 'global'.)
at _checkDiagnostics (D:\work\nodejs\keypos\aot\node_modules\@ngtools\webpack\src\loader.js:145:15)
at D:\work\nodejs\keypos\aot\node_modules\@ngtools\webpack\src\loader.js:172:17
Mention any other details that might be useful.
I run angular2 in electron,use jit compiler work fne,but when change to aot have failed, and i already add node typedefintion in typings
"node": "registry:dt/node#6.0.0+20160613154055",
already try npm i @types/node
finally,i get same error.
Metadata
Metadata
Assignees
Labels
No labels