简体   繁体   English

无法运行 Angular4 应用程序

[英]Unable to run Angular4 application

I have set up a Sinopia server in which I have published my private modules, I am importing these modules in a common UI framework and trying to run it.我已经建立了一个 Sinopia 服务器,在其中发布了我的私有模块,我将这些模块导入到一个通用的 UI 框架中并尝试运行它。

Following is my app.module.ts code where I am importing the modules以下是我导入模块的 app.module.ts 代码

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppRouting } from './app.routing';
import { AppComponent } from './app.component';
import { FlashAppModule } from '@netapp/flash-advisor-ui';
import { UIComponentModule } from '../ui/ui.component.module'
import { PerformanceAppModule } from '@netapp/performance-dashboard';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        FlashAppModule,
        PerformanceAppModule,
        FormsModule,
        HttpModule,
        AppRouting,
        UIComponentModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }

when I am starting the application npm start I get the following error.当我启动应用程序npm start ,出现以下错误。 I have not written a single line of code using lambda func.我没有使用 lambda func 写过一行代码。 I have just imported these modules that's it.我刚刚导入了这些模块,就是这样。

ERROR in Error: Error encountered resolving symbol values statically.错误中的错误:静态解析符号值时遇到错误。 Function calls are not supported.不支持函数调用。 Consider replacing the function or lambda with a reference to an exported function (position 194:50 in the original .ts file), resolving symbol NgModule in C:/sinopia/tes t/gtest/node_modules/@netapp/flash-advisor-ui/node_modules/@angular/core/core.d.ts, resolving symbol FlashAppModule in C:/sinopia/test/gt est/node_modules/@netapp/flash-advisor-ui/src/app/app.module.ts, resolving symbol FlashAppModule in C:/sinopia/test/gtest/node_modules/@n etapp/flash-advisor-ui/src/app/app.module.ts at positionalError (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:23957:35) at simplifyInContext (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:23800:27) at StaticReflector.simplify (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:23814:13) at StaticReflector.annotations (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:23263:41) at _getNgModuleMetadata (C:\\sinopia\\test\\gtest\\node_modul考虑将函数或 lambda 替换为对导出函数的引用(原始 .ts 文件中的位置 194:50),解析 C:/sinopia/tes t/gtest/node_modules/@netapp/flash-advisor-ui 中的符号 NgModule /node_modules/@angular/core/core.d.ts,解析C:/sinopia/test/gt est/node_modules/@netapp/flash-advisor-ui/src/app/app.module.ts中的符号FlashAppModule,解析符号 FlashAppModule 在 C:/sinopia/test/gtest/node_modules/@n etapp/flash-advisor-ui/src/app/app.module.ts at positionalError (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\ compiler\\bundles\\compiler.umd.js:23957:35)在simpleInContext(C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:23800:27)在StaticReflector.simplify( C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler\\bundles\\compiler.umd.js:23814:13) 在 StaticReflector.annotations (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler\\bundles \\compiler.umd.js:23263:41) 在 _getNgModuleMetadata (C:\\sinopia\\test\\gtest\\node_modul es\\@angular\\compiler-cli\\src\\ngtools_impl.js:126:31) at _extractLazyRoutesFromStaticModule (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_impl.js:101:26) at C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_impl.js:117:27 at Array.reduce (native) at _extractLazyRoutesFromStaticModule (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_impl.js:116:10) at Object.listLazyRoutesOfModule (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_impl.js:52:22) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_api.js:79:3 9) at AotPlugin._getLazyRoutesFromNgtools (C:\\sinopia\\test\\gtest\\node_modules\\@ngtools\\webpack\\src\\plugin.js:207:44) at _donePromise.Promise.resolve.then.then.then.then.then (C:\\sinopia\\test\\gtest\\node_modules\\@ngtools\\webpack\\src\\plugin.js:443:24) at process._tickCallback (internal/process/next_tick.js:103:7) webpack: Failed to comp es\\@angular\\compiler-cli\\src\\ngtools_impl.js:126:31) 在 _extractLazyRoutesFromStaticModule (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_impl.js:101:26)在 C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_impl.js:117:27 在 Array.reduce (native) 在 _extractLazyRoutesFromStaticModule (C:\\sinopia\\test\\gtest\\node_modules\\@ angular\\compiler-cli\\src\\ngtools_impl.js:116:10) 在 Object.listLazyRoutesOfModule (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_impl.js:52:22) 在Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\\sinopia\\test\\gtest\\node_modules\\@angular\\compiler-cli\\src\\ngtools_api.js:79:3 9) at AotPlugin._getLazyRoutesFromNgtools (C:\\sinopia\\test\\gtest\\node_module \\@ngtools\\webpack\\src\\plugin.js:207:44) 在 _donePromise.Promise.resolve.then.then.then.then.then (C:\\sinopia\\test\\gtest\\node_modules\\@ngtools\\webpack\\src \\plugin.js:443:24) 在 process._tickCallback (internal/process/next_tick.js:103:7) webpack:无法压缩ile.伊莱。

From the error I can see that you're using AOT.从错误中我可以看出您正在使用 AOT。 Yes, AOT doesn't support arrow functions as it said in the error text.是的,AOT 不支持错误文本中所说的箭头功能。 And yes, please post error text right in the question body.是的,请在问题正文中直接发布错误文本。 PS Nothing new I can say - please check again that your code valid for AOT compilation. PS 没什么可说的 - 请再次检查您的代码是否对 AOT 编译有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM