我在角度2应用程序中使用@angular/router
路由器模块。我再次运行npm install
并收到以下错误消息angular/core has no NgModuleFactoryLoader
。我在网上找到了以下内容:
npm remove @angular/router --save // will remove the RC router
npm install @angular/router@3.0.0-alpha.7 --save // will install the latest router
link:https://github.com/angular/angular/issues/9344
这解决了我的问题,但在删除我的node_modules并运行npm install后,问题又回来了。
我的依赖项:
"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.2.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-alpha.7",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.5",
"angular2-datatable": "^0.4.2",
"es6-shim": "^0.35.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.27",
"zone.js": "^0.6.12"
},
"devDependencies": {
"concurrently": "^2.0.0",
"del": "^2.2.0",
"gulp": "^3.9.1",
"gulp-browserify": "^0.5.1",
"gulp-concat": "^2.6.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-tslint": "^4.3.3",
"gulp-typescript": "^2.12.0",
"gulp-util": "^3.0.7",
"lite-server": "^2.2.0",
"tslint": "^3.5.0",
"typescript": "^1.8.10",
"typings": "^1.0.4"
}
有没有人知道为什么会这样? 提前致谢