我正在进行一个NG 4项目,我的package.json显示我正在运行角度4.4.6。我正在尝试添加 angular-4-data-table-bootstrap-4 包,如下所示,但我得到以下错误,我无法弄清楚如何解决。
[root@vm-dev-fedora25x64 src]# npm install angular-4-data-table-bootstrap-4 --save
myproject@1.2.3 /myproject/src
├── UNMET PEER DEPENDENCY @angular/core@4.4.6
└─┬ angular-4-data-table-bootstrap-4@0.2.0
├─┬ @angular/platform-server@4.4.6
│ ├── parse5@3.0.3
│ └── xhr2@0.1.4
├── @types/node@8.0.53
└─┬ ts-node@3.3.0
├── minimist@1.2.0
└─┬ v8flags@3.0.1
└─┬ homedir-polyfill@1.0.1
└── parse-passwd@1.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN angular-2-data-table@0.1.2 requires a peer of @angular/core@^2.0.0 but none was installed.
该错误表示未满足的对等依赖项angular/core@4.4.6但我安装了该版本!最后一行表明它(也)尝试安装需要angular core 2.0.0的angular-2-data-table软件包。到底是怎么回事?如何获得 angular-4-data-table-bootstrap-4 包?
packages.json的依赖项部分是:
"@angular/animations": "^4.4.6",
"@angular/cdk": "^2.0.0-beta.12",
"@angular/common": "^4.4.6",
"@angular/compiler": "^4.4.6",
"@angular/core": "^4.4.6",
"@angular/forms": "^4.4.6",
"@angular/http": "^4.4.6",
"@angular/material": "^2.0.0-beta.12",
"@angular/platform-browser": "^4.4.6",
"@angular/platform-browser-dynamic": "^4.4.6",
"@angular/router": "^4.4.6",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.30",
"@types/ip": "0.0.30",
"@types/node": "^6.0.88",
"angular-2-data-table": "^0.1.2",
"angular-4-data-table": "^0.2.4",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"ip": "^1.1.5",
"ngx-loading": "^1.0.8",
"rxjs": "^5.5.2",
"zone.js": "^0.8.18"
答案 0 :(得分:0)
尝试安装它,它将工作所有最新版本的角度
npm install angular-2-data-table --save