Starfleet Security
Starfleet Security

Reputation: 1843

npm packages not updating from package.json

I have an Angular .NET core website that was created with the default 4.2.5 version. I'd like to update this to 5.2.7 (or later), and I've updated the package.json file to reflect this:

{
  "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. 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). 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. I have no idea what I could be doing wrong.

Upvotes: 0

Views: 3353

Answers (1)

Ali Shahzad
Ali Shahzad

Reputation: 5332

Remove the node_modules folder and run these commands npm cache clean and then npm install from the folder containing package.json. Also try downgrading the Typescript version to say 2.6.2.

Upvotes: 1

Related Questions