khalil _diouri khalil _diouri - 2 months ago 5
TypeScript Question

angular2 rc5 Error loading http://localhost:3000/node_modules/@angular/forms.js

I want to migrate from angular2 rc4 to rc5

and I'm able to lanch my project


'use strict';
import { browserDynamicPlatform } from '@angular/platform-browser-dynamic';
import {AppModule} from "./AppModule";

.catch(err => console.error(err));

this is my AppModule.ts

imports: [
declarations: [
// CrisisListComponent
providers: [
bootstrap: [ AppComponent ]
export class AppModule {

and my appRouting

const appRoutes: Routes = [
{path: '', component: loginComponent},
{path: 'login', component: loginComponent},


export const appRoutingProviders: any[] = [

export const routing = RouterModule.forRoot(appRoutes);

and I getting this error

enter image description here


I should comment first to ask my question, but I don't have enough reputation so I'll ask them here in my answer :

  • Did your forms work in RC4 before upgrading to RC5 ?
  • Did you make sure you upgraded all the packages to RC5 ?
  • Also, you should check your systemjs.config.js as well, the problem could be coming from there as well.

I think it's coming from your "@angular/forms": "0.3.0" package, which is not up to date, but I'm not sure and I need more information to be sure of it, but if that's the case, you should check this out :

My package.json file with the last versions is looking like that :

"dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",

    "angular2-in-memory-web-api": "0.0.15",

    "systemjs": "0.19.36",
    "core-js": "^2.4.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.11",
    "zone.js": "^0.6.12"

You can either manually update all the packages, or you can use a tool for that as well. I recommend using npm-check-updates :

Typing ncu shows me what packages need to be updated, and ncu -u will get the latests versions for each package.

After that, if you did it correctly, and if you did configure the new Angular2 RC5 NgModules correctly, your app should work just like before.

Hope this helps.