angular - Angular2 - Unresolved Router Import -


i building ionic2 application , have been following heroes example on ionic framework official website have been having hard times importing router directives.

    import { providerouter, routerconfig } '@angular/router';      export const routes: routerconfig = [     { path: 'crisis-center', component: crisiscentercomponent },     { path: 'heroes', component: herolistcomponent },     { path: 'hero/:id', component: herodetailcomponent }];                                      export const app_router_providers = [     providerouter(routes) ]; 

the error piece of code produces is:

unresolved providerouter

unresolved routerconfig

cannot resolve directory @angular

any ideas why might be?

the package.json file looks this:

 {   "dependencies": {     "@angular/common": "2.0.0-rc.3",     "@angular/compiler": "2.0.0-rc.3",     "@angular/core": "2.0.0-rc.3",     "@angular/platform-browser": "2.0.0-rc.3",     "@angular/platform-browser-dynamic": "2.0.0-rc.3",     "@angular/http": "2.0.0-rc.3",     "es6-shim": "^0.35.0",     "ionic-angular": "2.0.0-beta.10",     "ionic-native": "1.2.4",     "ionicons": "3.0.0",     "reflect-metadata": "^0.1.3",     "rxjs": "5.0.0-beta.6",     "zone.js": "^0.6.12"   },   "devdependencies": {     "del": "2.2.0",     "gulp": "3.9.1",     "gulp-watch": "4.3.5",     "ionic-gulp-browserify-typescript": "2.0.0",     "ionic-gulp-fonts-copy": "^1.0.0",     "ionic-gulp-html-copy": "^1.0.0",     "ionic-gulp-sass-build": "^1.0.0",     "ionic-gulp-scripts-copy": "^2.0.0",     "run-sequence": "1.1.5"   },   "name": "test",   "description": "test: ionic project",   "cordovaplugins": [     "cordova-plugin-device",     "cordova-plugin-console",     "cordova-plugin-whitelist",     "cordova-plugin-splashscreen",     "cordova-plugin-statusbar",     "ionic-plugin-keyboard"   ],   "cordovaplatforms": [] } 

after manually inserted router dependency suggested @matwiligora, got following error when tried npm install

    npm warn peerdependencies peer dependency @angular/core@^2.0.0-rc.4 included @angular/router no npm warn peerdependencies longer automatically installed fulfill peerdependency npm warn peerdependencies in npm 3+. application need depend on explicitly. npm warn peerdependencies peer dependency @angular/compiler@^2.0.0-rc.4 included @angular/router no npm warn peerdependencies longer automatically installed fulfill peerdependency npm warn peerdependencies in npm 3+. application need depend on explicitly. npm warn peerdependencies peer dependency @angular/common@^2.0.0-rc.4 included @angular/router no npm warn peerdependencies longer automatically installed fulfill peerdependency npm warn peerdependencies in npm 3+. application need depend on explicitly. npm warn peerdependencies peer dependency @angular/platform-browser@^2.0.0-rc.4 included @angular/router no npm warn peerdependencies longer automatically installed fulfill peerdependency npm warn peerdependencies in npm 3+. application need depend on explicitly. npm warn peerdependencies peer dependency @angular/platform-browser-dynamic@^2.0.0-rc.4 included @angular/router no npm warn peerdependencies longer automatically installed fulfill peerdependency npm warn peerdependencies in npm 3+. application need depend on explicitly. 

and

npm err! argv "c:\\program files\\nodejs\\node.exe" "c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" npm err! node v4.4.7 npm err! npm  v2.15.8 npm err! code epeerinvalid  npm err! peerinvalid package @angular/common@2.0.0-rc.3 not satisfy siblings' peerdependencies requirements! npm err! peerinvalid peer @angular/router@3.0.0-beta.2 wants @angular/common@^2.0.0-rc.4 npm err! peerinvalid peer @angular/platform-browser@2.0.0-rc.3 wants @angular/common@2.0.0-rc.3 npm err! peerinvalid peer @angular/platform-browser-dynamic@2.0.0-rc.3 wants @angular/common@2.0.0-rc.3 npm err! peerinvalid peer ionic-angular@2.0.0-beta.10 wants @angular/common@^2.0.0-rc.3  npm err! please include following file support request: npm err!  npm-debug.log 

make sure installing "@angular/router": "3.0.0-beta.2" dependency in package.json, current version of router.

also did inject: app_router_providers bootstrap ?


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -