# Best way to upgrade Aurelia-Cli apps

**URL:** <https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324>\
**Category:** Best Practices\
**Created:** [November 7, 2017, 9:19pm UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324 "2017-11-07T21:19:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![CRL](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@CRL](https://discourse.aurelia.io/u/CRL)\
**Post date:** [November 7, 2017, 9:19pm UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/1 "2017-11-07T21:19:22Z")

</div>

What is the best way to keep an Aurelia-CLI application up to date? It would be nice if there was a CLI option that would update (at least all Aurelia modules) so that we can keep up-to-date on Aurelia Projects

---

<div class="post-metadata">

**Author:** ![winter\_limelight](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/winter_limelight/32/226_2.png) [@winter\_limelight](https://discourse.aurelia.io/u/winter_limelight)\
**Post date:** [November 8, 2017, 9:33am UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/2 "2017-11-08T09:33:41Z")

</div>

My personal procedure is to create a new project using `au new` then use kdiff to compare the aurelia\_project/tasks folders of the new project with my existing one.

I have a custom task which I added to build.ts so I can’t just copy new project files over the top. If it were possible to have these custom tasks outside of the tasks folder and somehow loaded through the configuration that would be handy (and would allow a copy/paste from a new project when cli updates).

---

<div class="post-metadata">

**Author:** ![fragsalat](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/fragsalat/32/270_2.png) [@fragsalat](https://discourse.aurelia.io/u/fragsalat)\
**Post date:** [November 9, 2017, 11:08am UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/3 "2017-11-09T11:08:25Z")

</div>

I run a grep to get all aurelia specific dependencies used in my code.

```
grep -rhoP "import.*\Kaurelia-[^']+" src | sort | uniq

```

From this I created a npm script to install dependencies with @latest

Here tthe relevant part of my package.json

```
{
    "name": "some-frontend",
    "description": "An Aurelia client application.",
    "version": "0.1.0",
    "repository": {
      "type": "git",
      "url": "https://github.bus.zalan.do/goodbuy/abba-frontend"
    },
    "scripts": {
      "update-aurelia": "npm i -D aurelia-bootstrapper@latest aurelia-configuration@latest aurelia-dependency-injection@latest aurelia-dialog@latest aurelia-event-aggregator@latest aurelia-framework@latest aurelia-http-client@latest aurelia-http-client-mock@latest aurelia-i18n@latest aurelia-metadata@latest aurelia-pal-browser@latest aurelia-path@latest aurelia-polyfills@latest aurelia-router@latest aurelia-templating@latest aurelia-templating-resources@latest aurelia-testing@latest"
    }
  }
```

---

<div class="post-metadata">

**Author:** ![rkever](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/rkever/32/145_2.png) [@rkever](https://discourse.aurelia.io/u/rkever)\
**Post date:** [November 9, 2017, 3:33pm UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/4 "2017-11-09T15:33:07Z")

</div>

I just wrote a task that handles updating all ‘aurelia???’ packages. No doubt it’s not full proof but simplifies writing out all the packages manually.

```auto
/*
* This file will update all aurelia framework packages.
* Just run from cmd "node update-aurelia.js"
*/

const package = require('../../package.json');
const npm = require('npm');
const dependencies = Object.assign(package.dependencies, package.devDependencies);
const exec = require('child_process').exec;

let aureliaPackages = '';

for (let [k, v] of Object.entries(dependencies)) {
    if (/aurelia/ig.test(k)) aureliaPackages += `${k}@latest `;
}

child = exec(`npm i ${aureliaPackages} -S`).stderr.pipe(process.stderr);

```

---

<div class="post-metadata">

**Author:** ![TonyLugg](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/tonylugg/32/307_2.png) [@TonyLugg](https://discourse.aurelia.io/u/TonyLugg)\
**Post date:** [April 7, 2019, 5:36pm UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/5 "2019-04-07T17:36:00Z")

</div>

I just updated a large project using CLI beta 13 to 15. Everything runs, but there are numerous differences in the package-lock.json from a new beta 15 app. With all the modules and dependencies, how does one keep everything up to date without au new and copying everything over. It is difficult to keep the git history correct if doing this.

Also, I used ncu to check for updates and it caught the Aurelia modules in the package.json file. What about the other Aurelia modules that are not listed in the package? How do we keep those up to date?

---

<div class="post-metadata">

**Author:** ![elitemike](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/elitemike/32/690_2.png) [@elitemike](https://discourse.aurelia.io/u/elitemike)\
**Post date:** [April 8, 2019, 3:29pm UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/6 "2019-04-08T15:29:43Z")

</div>

I too need this answer, I always do the au new approach

---

<div class="post-metadata">

**Author:** ![TonyLugg](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/tonylugg/32/307_2.png) [@TonyLugg](https://discourse.aurelia.io/u/TonyLugg)\
**Post date:** [April 26, 2019, 5:55pm UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/7 "2019-04-26T17:55:29Z")

</div>

Anyone on the Aurelia team have some advice for this? Perhaps it would be possible to add a command to the CLI, like `au upgrade` to bring all the Aurelia modules and configuration up to the same level you would have if you created a new project with `au new`.

---

<div class="post-metadata">

**Author:** ![brandonseydel](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.aurelia.io/brandonseydel/32/993_2.png) [@brandonseydel](https://discourse.aurelia.io/u/brandonseydel)\
**Post date:** [April 26, 2019, 7:20pm UTC](https://discourse.aurelia.io/t/best-way-to-upgrade-aurelia-cli-apps/324/8 "2019-04-26T19:20:18Z")

</div>

This will be much more achievable with Aurelia 2 since it is a monorepo and we can pin a version with all relevant versions pinned as well. So we can be on Aurelia 2.0.1 and Aurelia-Router 2.0.0 but the  
au upgrade 2.0.1 would be able to associate the older version of the router to the newer version of aurelia. Version synching is also much more achievable.
