Akash
Akash

Reputation: 988

update package.json file after Upgrade from @angular/cli 1.4.4 to 1.4.7

I am working on an angular project created using @angular/cli 1.4.4. Now I have upgraded my @angular/cli to 1.4.7 . Now I am wondering , how should I be updating my project's package.json file. I did not find a decent way on the web so I just created an new test project using @angular/cli 1.4.7 and than used it's package.json file in the existing project. Do we have a decent/official way of upgrading package.json file after updating @angular/cli version ??

Upvotes: 3

Views: 5947

Answers (2)

pixel 67
pixel 67

Reputation: 1618

To update all the outdated packages in your package.jsonfile, use npm-check -u this will let you update your packages interactively in the terminal. It's the best way I've found to do something like this.

Upvotes: 1

Hamed Baatour
Hamed Baatour

Reputation: 6932

apparently, you are still a beginner and what you should understand is that @angular/cli is a simple npm package as any other package you install from npm so after you update your angular cli globally:

npm install -g @angular/cli

simply run the following commands to update the @angular/cli package locally in your project:

npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli

Edit:

angular cli does not offer a way to update your npm packages associated with your project so your best bet is to install a tool like npm-check-updates which will check and update your outdated dependencies in your package.json file including @angular/cli package.

npm install -g npm-check-updates
ncu -u

Upvotes: 3

Related Questions