npm没有安装我期望的版本

时间:2018-03-09 19:45:35

标签: npm

我使用Visual Studio 2017中的模板创建了一个.NET Core 2 Angular应用程序,而且一切都很糟糕。

在某些时候我决定要升级到Angular 4.3中的新HttpClientModule,所以在我的package.json中我改了

"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/compiler-cli": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/platform-server": "4.2.5",
"@angular/router": "4.2.5",

"@angular/animations": "4.3",
"@angular/common": "4.3",
"@angular/compiler": "4.3",
"@angular/compiler-cli": "4.3",
"@angular/core": "4.3",
"@angular/forms": "4.3",
"@angular/platform-browser": "4.3",
"@angular/platform-browser-dynamic": "4.3",
"@angular/platform-server": "4.3",
"@angular/router": "4.3",

我删除了我的node_modules文件夹并运行了npm install,输出显示

+-- @angular/animations@4.2.5 
+-- @angular/common@4.2.5 
+-- @angular/compiler@4.2.5 
+-- @angular/compiler-cli@4.2.5 
| `-- minimist@1.2.0 
+-- @angular/core@4.2.5 
+-- @angular/forms@4.2.5 
+-- @angular/http@4.2.5 
+-- @angular/platform-browser@4.2.5 
+-- @angular/platform-browser-dynamic@4.2.5 
+-- @angular/platform-server@4.2.5 
+-- @angular/router@4.2.5 

我与npm的专家相距甚远,所以我假设我在使用或我的期望中犯了一些菜鸟错误。有人可以建议吗?

1 个答案:

答案 0 :(得分:0)

由于您没有package-lock.json,我建议您在项目文件夹中查找并删除npm-shrinkwrap.json,然后再次运行npm install