无法在angular2应用程序中添加Private npm模块作为依赖项

时间:2017-09-27 21:11:37

标签: angular npm angularjs-scope angular2-forms sinopia

我已经建立了一个Pvt sinopia服务器,我已经发布了我的应用程序(节点模块)。现在,我已经创建了一个新的本地Angular2项目,我在其中安装了这些应用程序(模块)作为依赖项。当我尝试使用这些模块时(在import中将其添加为app.module.ts) 我在app的app.module.ts中添加了以下内容

import { FlashAppModule } from '@netapp/flash-advisor-ui';

@NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, HttpModule, FlashAppModule ],

我收到以下错误。

错误是要求将@ angular / lambda函数转换为导出函数。

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/codeTest/node_modules/@netapp/flash -advisor-ui/node_modules/@angular/core/core.d.ts, resolving symbol FlashAppModule in C:/sinopia/codeTest/node_modules/@netapp/flash-advisor-ui/src/app/ap p.module.ts, resolving symbol FlashAppModule in C:/sinopia/codeTest/node_modules/@netapp/flash-advisor-ui/src/app/app.module.ts at positionalError (C:\sinopia\codeTest\node_modules\@angular\compiler\bundles\compiler.umd.js:25935:39) at simplifyInContext (C:\sinopia\codeTest\node_modules\@angular\compiler\bundles\compiler.umd.js:25772:31) at StaticReflector.simplify (C:\sinopia\codeTest\node_modules\@angular\compiler\bundles\compiler.umd.js:25786:17) at StaticReflector.annotations (C:\sinopia\codeTest\node_modules\@angular\compiler\bundles\compiler.umd.js:25282:64) at _getNgModuleMetadata (C:\sinopia\codeTest\node_modules\@angular\compiler-cli\src\ngtools_impl.js:126:31) at _extractLazyRoutesFromStaticModule (C:\sinopia\codeTest\node_modules\@angular\compiler-cli\src\ngtools_impl.js:101:26) at C:\sinopia\codeTest\node_modules\@angular\compiler-cli\src\ngtools_impl.js:117:27 at Array.reduce (native) at _extractLazyRoutesFromStaticModule (C:\sinopia\codeTest\node_modules\@angular\compiler-cli\src\ngtools_impl.js:116:10) at Object.listLazyRoutesOfModule (C:\sinopia\codeTest\node_modules\@angular\compiler-cli\src\ngtools_impl.js:52:22) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\sinopia\codeTest\node_modules\@angular\compiler-cli\src\ngtools_api.js:78:39) at AotPlugin._getLazyRoutesFromNgtools (C:\sinopia\codeTest\node_modules\@ngtools\webpack\src\plugin.js:207:44) at _donePromise.Promise.resolve.then.then.then.then.then (C:\sinopia\codeTest\node_modules\@ngtools\webpack\src\plugin.js:443:24) at process._tickCallback (internal/process/next_tick.js:103:7) webpack: Failed to compile.

0 个答案:

没有答案