Use ember with the CLI

Hi there, I am totally new to ember.js and I am working on LInux I just installed node, npm and ember, but…

  1. After a successful installation of ember-cli, the version is still 0.7.2 unless a message saying +ember -cli@3.20.0 after ember installation
  2. Each command I enter which start with ember (such as ember help new) opens up the ember gui named ember.bin in a new window

I need help pls

Thank you

Hi @Ricker_Kuate, how did you install node (and what version of node do you have?)? I generally prefer nvm but it’s not necessary, just makes it easier to swap out node versions if you need to.

And once you installed node I assumed you just did npm install -g ember-cli?

And when you say:

the version is still 0.7.2

What do you mean by “still”? Are you looking at an existing project? One thing to note is that your global ember cli version is important but if you’re in an existing project it will use whatever version is installed in that project (for compatibility reasons). So installing ember-cli globally at a specific version won’t upgrade a project’s version, you’ll have to do that separately.

Hi dknutsen,

I’m using nvm now and the version of Node I’m using is v12.16.1

I have an existing ember project that uses Ember v2.14.0

The existing project is not taking advantage of ember-cli

I would like to upgrade the project to use ember-cli but am unsure of how to do this as it is a rather complex project (not mine, legacy code). Any tips for moving an ember project over to leverage ember-cli?

That’s a tough one since IIRC if you’re not using ember-cli it’s anyone’s guess exactly how things are wired up to build, etc. At a high level I’d think you’d want to try adding ember cli at roughly the same version (2.14ish), ripping out any build related code from your project and focusing on getting it to build correctly. I imagine you’ll have some 3rd party libraries that you may need to work into your build differently… Does it use broccoli for building still?

Once you’ve got ember-cli working you could step through the upgrade process from there and it should be much more straightforward.

Unfortunately I only barely remember life before ember-cli, but maybe someone like @ef4 would have better tips.

EDIT: here are a few resources that may be helpful, depending on what you’re migrating from:

Also you may need to drop your node version way down w/ nvm before attempting this. Maybe try node 8ish?

1 Like

One of the most popular setups before ember-cli was ember-app-kit. It has docs on how to migrate to ember-cli: https://github.com/stefanpenner/ember-app-kit

1 Like

Thanks, :smiley: this is really good advice and will definitely help as I’m a “React” person trying to pick up an Ember project with no Ember experience. I really appreciate it!

EDIT: To answer your question about how it builds, It uses Grunt task runner to build

This is another article I ran across specifically about grunt -> ember-cli, maybe it will also be helpful: https://blogs.oracle.com/developers/making-the-big-switch:-ember-cli-conversion-from-grunt

1 Like