###错误代码 ERROR in ./src/app/base/environment.ts Module build failed: TypeError: Cannot read property 'flags' of undefined at Object.isExternalModuleSymbol (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:73503:40) at getExportInfo (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:77753:23) at exportInfo (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:77699:34) at getExport (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:77642:36) at Object.getImportOrExportSymbol (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:77613:53) at getImportOrExportReferences (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:78575:56) at getReferencesAtLocation (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:78516:17) at getReferencesInContainer (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:78470:21) at getReferencedSymbolsForSymbol (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:78137:21) at Object.getReferencedSymbolsForNode (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:78048:24) at Object.getReferenceEntriesForNode (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:77869:58) at getSemanticDocumentHighlights (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:76624:57) at Object.getDocumentHighlights (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:76613:20) at Object.getDocumentHighlights (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:89401:42) at NoUseBeforeDeclareWalker.validateUsageForVariable (/Users/liuping/cmsUseNg2/node_modules/tslint/lib/rules/noUseBeforeDeclareRule.js:113:47) at NoUseBeforeDeclareWalker.visitVariableDeclaration (/Users/liuping/cmsUseNg2/node_modules/tslint/lib/rules/noUseBeforeDeclareRule.js:106:18) at NoUseBeforeDeclareWalker.SyntaxWalker.visitNode (/Users/liuping/cmsUseNg2/node_modules/tslint/lib/language/walker/syntaxWalker.js:502:22) at NoUseBeforeDeclareWalker.ScopeAwareRuleWalker.visitNode (/Users/liuping/cmsUseNg2/node_modules/tslint/lib/language/walker/scopeAwareRuleWalker.js:58:36) at /Users/liuping/cmsUseNg2/node_modules/tslint/lib/language/walker/syntaxWalker.js:523:63 at visitEachNode (/Users/liuping/cmsUseNg2/node_modules/typescript/lib/typescript.js:15956:30) ###解决方法 执行如下命令 npm run build:prod 原因:环境变量改变了
转载于:https://my.oschina.net/pingheyongfeng/blog/1518259