[英]npm packages not updating from package.json
I have an Angular .NET core website that was created with the default 4.2.5 version. 我有一个使用默认4.2.5版本创建的Angular .NET核心网站。 I'd like to update this to 5.2.7 (or later), and I've updated the package.json file to reflect this:
我想将其更新为5.2.7(或更高版本),并且我已经更新了package.json文件以反映这一点:
{
"name": "JobWeb",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"devDependencies": {
"@angular/animations": "5.2.7",
"@angular/common": "5.2.7",
"@angular/compiler": "5.2.7",
"@angular/compiler-cli": "5.2.7",
"@angular/core": "5.2.7",
"@angular/forms": "5.2.7",
"@angular/platform-browser": "5.2.7",
"@angular/platform-browser-dynamic": "5.2.7",
"@angular/platform-server": "5.2.7",
"@angular/router": "5.2.7",
"@ngtools/webpack": "1.10.1",
"@types/chai": "4.1.2",
"@types/jasmine": "2.8.6",
"@types/webpack-env": "1.13.5",
"angular2-router-loader": "0.3.5",
"angular2-template-loader": "0.6.2",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.3",
"awesome-typescript-loader": "3.5.0",
"bootstrap": "4.0.0",
"chai": "4.1.2",
"css": "2.2.1",
"css-loader": "0.28.10",
"es6-shim": "0.35.3",
"event-source-polyfill": "0.0.12",
"expose-loader": "0.7.4",
"extract-text-webpack-plugin": "3.0.2",
"file-loader": "1.1.11",
"html-loader": "0.5.5",
"isomorphic-fetch": "2.2.1",
"jasmine-core": "3.1.0",
"jquery": "3.3.1",
"json-loader": "0.5.7",
"karma": "2.0.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.1",
"karma-webpack": "2.0.13",
"node-sass": "^4.7.2",
"preboot": "6.0.0-beta.3",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.12",
"rxjs": "5.5.6",
"sass-loader": "^6.0.7",
"style-loader": "0.20.2",
"to-string-loader": "1.1.5",
"typescript": "2.7.2",
"url-loader": "1.0.1",
"webpack": "4.1.0",
"webpack-hot-middleware": "2.21.2",
"webpack-merge": "4.1.2",
"zone.js": "0.8.20"
},
"dependencies": {
"popper.js": "^1.13.0"
}
}
I have tried to highlight all the packages in solution explorer and "update" that way. 我试图突出显示解决方案资源管理器中的所有软件包,并以这种方式“更新”。 I have also tried to delete the node_packages folder and then do a restore.
我也曾尝试删除node_packages文件夹,然后进行还原。 No matter what, I either end up with missing packages (exclamation on them), or it installs angular 4.2.5 again (and probably older versions of other stuff too).
无论如何,我要么最终会丢失软件包(对它们惊叹),要么会再次安装angular 4.2.5(可能还会安装其他版本的旧版本)。 I used NCU to get my package.json file so it had the latest (or close to latest) versions of everything (which gave me angular 5.2.7, which would be fine), but I can't seem to get everything to actually install properly.
我使用NCU来获取我的package.json文件,因此它具有所有内容的最新版本(或接近最新版本)(这使我获得了5.2.7的支持,这很好),但是我似乎无法真正获取所有内容正确安装。 I have no idea what I could be doing wrong.
我不知道我会做错什么。
Remove the node_modules
folder and run these commands npm cache clean
and then npm install
from the folder containing package.json
. 删除
node_modules
文件夹并运行以下命令npm cache clean
,然后从包含package.json
的文件夹中npm install
。 Also try downgrading the Typescript version to say 2.6.2. 还可以尝试将Typescript版本降级为2.6.2。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.