我尝试将我的angular 2应用程序升级到RC5并遇到一些我正在使用的第三方库的错误,所以我决定回到RC4 . 我克隆了我在RC4上成功运行的仓库,运行了npm install等,现在我运行“npm start”时遇到了这个错误:
(index):32 Error: Error: DI Exception
at NoProviderError.BaseException [as constructor] (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:4472:27)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:4602:20)
at new NoProviderError (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:4638:20)
at ReflectiveInjector_._throwOrNull (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:6532:23)
at ReflectiveInjector_._getByKeyDefault (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:6560:29)
at ReflectiveInjector_._getByKey (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:6523:29)
at ReflectiveInjector_._getByReflectiveDependency (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:6513:25)
at ReflectiveInjector_._instantiate (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:6411:40)
at ReflectiveInjector_._instantiateProvider (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:6382:29)
at ReflectiveInjector_._new (http://localhost:3000/node_modules/@angular/core//bundles/core.umd.js:6371:25)
Evaluating http://localhost:3000/app/main.js
Error loading http://localhost:3000/app/main.js
我很困惑,为什么现在以前工作不起作用 . 我的环境中的某些东西必须已经改变才会导致这些问题 . 这是我的一些设置看起来像...
main.ts:
let appProviders = [
DivisionProposalsService,
HTTP_PROVIDERS,
LoggedInUser,
TimelineService,
UserService,
LeadService,
GeneralInfoService,
FileService,
Parameters
]
bootstrap(AppComponent, [
appProviders,
appRouterProviders,
disableDeprecatedForms(),
provideForms()
])
.catch(err => console.error(err));
app.component.ts:
@Component({
selector: 'my-app',
template: `
<navigation></navigation>
<router-outlet></router-outlet>
<!--<proposal-page></proposal-page>-->
`,
directives: [NavigationComponent, DivisionProposalsComponent, ProposalPageComponent, ROUTER_DIRECTIVES]
})
export class AppComponent {
...
我真的不知道要显示的其他代码,因为错误是如此通用 .
这些npm安装警告可能与它有关吗?
npm安装
angular2-quickstart@1.0.0 postinstall C:\ test2 typings install
类型WARN不推荐使用2016年7月25日:“注册表:dt / core-js#0.0.0 20160602141332”已被弃用(更新,替换或删除)类型WARN已弃用2016年8月23日:“registry:dt / node#6.0 . 0 20160621231320“已弃用(已更新,已更换或删除)
├──core-js(全球)├──茉莉(全球)└──节点(全球)
npm WARN可选跳过失败的可选依赖项/ chokidar / fsevents:
npm WARN notsup与您的操作系统或体系结构不兼容:fsevents@1.0.14
npm WARN @ angular / core @ 2.0.0-rc.5需要一个rxjs@5.0.0-beta.6的对等体,但没有安装 .
npm WARN @ angular / http @ 2.0.0-rc.4需要一个rxjs@5.0.0-beta.6的对等体,但没有安装 .
npm WARN @ angular / platform-server @ 2.0.0-rc.3需要@ angular / core @ 2.0.0-rc.3的对等,但没有安装 .
npm WARN @ angular / platform-server @ 2.0.0-rc.3需要@ angular / common @ 2.0.0-rc.3的对等体,但没有安装 .
npm WARN @ angular / platform-server @ 2.0.0-rc.3需要@ angular / compiler @ 2.0.0-rc.3的对等体,但没有安装 .
npm WARN @ angular / platform-server @ 2.0.0-rc.3需要@ angular / platform-browser @ 2.0.0-rc.3的同行,但没有安装 .
npm WARN @ angular / router @ 3.0.0-beta.1需要一个rxjs@5.0.0-beta.6的对等体,但没有安装 .
npm WARN angular2-in-memory-web-api@0.0.11需要@ angular / core @ 2.0.0-rc.1的对等方,但没有安装 .
npm WARN angular2-in-memory-web-api@0.0.11需要@ angular / http @ 2.0.0-rc.1的同伴,但没有安装 .
npm WARN angular2-in-memory-web-api@0.0.11需要rxjs@5.0.0-beta.6的对等体,但没有安装 .
npm WARN angular2-modal@1.1.2需要rxjs@5.0.0-beta.6的对等体,但没有安装 .
npm WARN ng2-bootstrap@1.0.24需要@ angular / common @ 2.0.0-rc.4的同伴,但没有安装 .
npm WARN ng2-bootstrap@1.0.24需要@ angular / compiler @ 2.0.0-rc.4的对等体,但没有安装 .
npm WARN ng2-bootstrap@1.0.24需要@ angular / core @ 2.0.0-rc.4的同行,但没有安装 .