升级到angular5 + ..'@ angular / router'不起作用

时间:2018-05-09 05:11:28

标签: angular datetimepicker

我试图在angular4中使用日期时间选择器。几乎所有日期/时间选择器都需要升级到angular5 +。所以我用两个命令更新了我的角度 -

使用以下命令更新Angular包。 npm install -g npm-check-updates 和ncu -u

来自网站 -

http://www.talkingdotnet.com/upgrade-angular-4-app-angular-5-visual-studio-2017/

变化是 -

的package.json

 @angular/cdk                              ^5.2.5  →  ^6.0.1
 @angular/common                            4.3.4  →   6.0.0
 @angular/compiler                          4.3.4  →   6.0.0
 @angular/core                              4.3.4  →   6.0.0
 @angular/forms                             4.3.4  →   6.0.0
 @angular/http                              4.3.4  →   6.0.0
 @angular/material                         ^5.2.5  →  ^6.0.1
  @angular/platform-browser                  4.3.4  →   6.0.0
 @angular/platform-browser-dynamic          4.3.4  →   6.0.0
 @angular/router                            4.3.4  →   6.0.0
 @angular/upgrade                           4.3.4  →   6.0.0
 @ng-bootstrap/ng-bootstrap         ^1.0.0-beta.6  →  ^2.0.0
 angular-2-local-storage                   ^1.0.1  →  ^2.0.0
 chart.js                                   2.6.0  →   2.7.2
 core-js                                    2.5.0  →   2.5.6
 localstorage                              ^0.1.0  →  ^1.0.1
 moment                                    2.18.1  →  2.22.1
 ng-pick-datetime                          ^5.2.6  →  ^6.0.1
 ng4-loading-spinner                       1.0.27  →   1.1.3
 ngx-bootstrap                              1.8.1  →   2.0.5
 restify                                   ^6.3.4  →  ^7.1.1
 rxjs                                       5.4.3  →   6.1.0
 zone.js                                   0.8.16  →  0.8.26
 @angular/cli                              ^1.7.3  →  ^6.0.0
 @angular/compiler-cli                      4.3.4  →   6.0.0
 @types/jasmine                            2.5.53  →   2.8.7
 @types/node                               8.0.20  →  10.0.6
 codelyzer                                  3.1.2  →   4.3.0
 jasmine-core                               2.7.0  →   3.1.0
 jasmine-spec-reporter                      4.2.0  →   4.2.1
 karma                                      1.7.0  →   2.0.2
 karma-coverage-istanbul-reporter           1.3.0  →   1.4.2
 karma-jasmine                              1.1.0  →   1.1.2
 karma-jasmine-html-reporter                0.2.2  →   1.0.0
 protractor                                 5.1.2  →   5.3.1
 ts-node                                    3.3.0  →   6.0.3
 tslint                                     5.6.0  →  5.10.0
 nodemon     ^1.17.3  →  ^1.17.4
 primeng      ^5.2.5  →   ^5.2.6
 sass         ^1.3.0  →   ^1.3.2
 typescript   ^2.3.4  →   ^2.8.3
 Upgraded /home/dell/Downloads/Datshare/Adaani5.0 (another 
   copy).0/package.json

然后我运行这个命令 -

     npm install  ng2-simple-timepicker

我想从这里使用timepicker -

   https://www.npmjs.com/package/ng2-simple-timepicker

但是它仍然没有认识到

 import { TimePickerModule } from "ng2-simple-timepicker/timepicker";


 import { Router, ActivatedRoute } from '@angular/router'
 import { Http, Response, Headers, HttpModule } from '@angular/http';

 import { FormGroup, FormControl, FormBuilder, Validators } from 
 '@angular/forms';

它说无法找到模块'@ angular / forms'等

请问为什么这些模块无法识别

0 个答案:

没有答案