How to Update to the Latest Ember, Ember Data and Ember CLI

Updating Ember is not rocket science, but many times a short guide can be very helpful. So here it is.

To find out the latest stable version, click here.

In this example, it’s 2.9.1.

Quick upgrade

If we need to perform a minor upgrade (for instance from version 2.9.0 to 2.9.1), we can try:

$ bower i ember#2.9.1 --save && ember i ember-data@2.9.1

Assuming these versions exist. Check the Ember latest version here and check the Ember Data latest version here.

Upgrading Ember CLI

  1. Remove current Ember CLI:

    $ npm uninstall -g ember-cli
    

  2. Clear npm & bower caches:

    $ npm cache clean && bower cache clean
    

  3. Install new Ember CLI:

    $ npm install -g ember-cli@2.9.1
    

Upgrading an Ember (and Ember Data) project

  1. Remove all temp folders:
    $ rm -rf node_modules bower_components dist tmp
    
  2. Install npm dependencies, saving Ember CLI as one of them:

    $ npm install --save-dev ember-cli@2.9.1
    

  3. Install bower dependencies:

    $ bower install
    

  4. The last important step is running the new project blueprint to our existing project. It allows us to review changes before applying (diff by pressing d).

    $ ember init
    
    installing app
    ? Overwrite .editorconfig? Yes, overwrite
    ? Overwrite .jshintrc? Yes, overwrite
    ? Overwrite .travis.yml? Yes, overwrite
    ? Overwrite README.md? Yes, overwrite
    ? Overwrite app/index.html? Yes, overwrite
    ? Overwrite app/router.js? Yes, overwrite
    ? Overwrite bower.json? Yes, overwrite
    ? Overwrite config/environment.js? Yes, overwrite
    ? Overwrite .gitignore? Yes, overwrite
    ? Overwrite package.json? Yes, overwrite
    ? Overwrite tests/.jshintrc? Yes, overwrite
    ? Overwrite tests/helpers/module-for-acceptance.js? Yes, overwrite
    ? Overwrite tests/index.html? Yes, overwrite
      identical .bowerrc
      overwrite .editorconfig
      identical .ember-cli
      overwrite .jshintrc
      overwrite .travis.yml
      identical .watchmanconfig
      overwrite README.md
      identical app/app.js
      overwrite app/index.html
      identical app/resolver.js
      overwrite app/router.js
      overwrite bower.json
      overwrite config/environment.js
      identical ember-cli-build.js
      overwrite .gitignore
      overwrite package.json
      identical public/crossdomain.xml
      identical public/robots.txt
      create testem.js
      overwrite tests/.jshintrc
      identical tests/helpers/destroy-app.js
      overwrite tests/helpers/module-for-acceptance.js
      identical tests/helpers/resolver.js
      identical tests/helpers/start-app.js
      overwrite tests/index.html
      identical tests/test-helper.js
    ⠋ Installing packages for tooling via npm
    Installed packages for tooling via npm.
    Installed browser packages via Bower.
    

Double-checking and booting the server

A quick version check will tell us if this went alright:

$ ember -v
ember-cli: 2.9.1
node: 6.3.1
os: darwin x64

Further, launching the app we can verify our Ember and Ember Data versions are properly set up:

$ ember server
Livereload server on http://localhost:49152
Serving on http://localhost:4200/

This is what we get in the console:

Success!

I have this summary in my bookmarks and access it frequently. I hope you find it useful, too!

Enjoyed this article? Don't miss my next one!

Leave me your e-mail for content that will help you master Ember:

Do you want to master Ember fast?

Leave me your e-mail for helpful updates delivered straight to your inbox.

(A few e-mails per month. No BS. Unsubscribe anytime!)