要更新 Angular Material版本,我运行了:
layout
这样做后, package.json 文件如下:
Android
显示
npm update @angular/material @angular/cdk
C:\ WorkEnvironment \ Developments> ng --version
[... snip ...]
"dependencies": {
"@agm/core": "1.0.0-beta.2",
"@angular/animations": "8.0.0",
"@angular/cdk": "8.0.1",
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/core": "8.0.0",
"@angular/flex-layout": "8.0.0-beta.26",
"@angular/forms": "8.0.0",
"@angular/material": "8.0.1",
"@angular/material-moment-adapter": "^8.0.1",
"@angular/platform-browser": "8.0.0",
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
[... snip ...]
当我这样做的时候(在Visual Studio Code中)
@angular/material": "8.0.1",
@angular/cdk": "8.0.1",`
为什么有区别?可以解决吗?
TIA
答案 0 :(得分:3)
npm -v
仅显示npm工具的版本。
要检查当前项目(目录)的已安装软件包,请尝试:
npm list
当您打开package.json文件时,Visual Studio Code的最新版本也会显示已安装的软件包版本。