简体   繁体   English

npm软件包未从package.json更新

[英]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.

相关问题 流星npm install从package.json安装错误的版本 - Meteor npm install installs wrong version from package.json Angular: Why would package-lock.json have higher versions of packages than package.json after fresh npm install? - Angular: Why would package-lock.json have higher versions of packages than package.json after fresh npm install? npm package.json没有文档的密钥 - npm package.json undocumented keys NPM-解决Package.json中的对等依赖项 - NPM - Resolving Peer Dependencies in Package.json npm WARN package.json最新版本 - npm WARN package.json for latest version npm 卸载会从 package.json 中删除 package,但不会从 node_modules 文件夹中删除它 - npm uninstall removes the package from package.json but doesn't remove it from node_modules folder Angular 6更新package.json中的过时依赖项 - Angular 6 updating outdated dependencies in package.json 如何在从 package.json 读取配置时拥有 npm 包的自动版本控制机制 - How to have automatic versioning mechanism of npm package while reading configuration from package.json npm 错误! 无法安装,因为它不包含 package.json 文件 angular firebase 函数 - npm ERR! Could not install from as it does not contain a package.json file angular firebase functions 使用 npm 运行 package.json 执行 ng 测试时无法使用 --include - Cannot use --include when executing ng test from package.json using npm run
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM