Installing Ember.js 2.2 - ember.js

I tried do install Ember.js v2.2 by following the official instructions: http://guides.emberjs.com/v2.2.0/getting-started/
installed Node.js and npm
installed Git
installed the Ember CLI via npm install -g ember-cli
Everything should be fine now.
But when I type ember -v to verify the Ember version, it says: 1.13.13
I did follow the 2.2 Instructions to the point, but I didn't get Ember.js 2.2 installed.
Any suggestions? I use Win 7.

For ember 2.2 + ember-data 2.3.1:
ember new <project> && cd <project>
Edit bower.json in your project root directory (you're there already if you followed the previous command):
Replace ember-cli-shims version number to 0.1.0
Replace ember version number to 2.2
Remove the ember-data dependency line
Add the following code just above the last }
,
"resolutions": {
"ember": "^2.2.0"
}
Edit package.json in your project root directory:
Replace ember-data version number to 2.3.1
Clean the caches, update the project dependencies and then restart ember:
npm cache clean && bower cache clean && npm install && bower install
ember serve
And you're done. Open your browser console and you should see debug messages with the 2.2 version of ember and 2.3.1 version of ember-data.

ember on the command line is actually invoking Ember-CLI, so ember -v will show you the version you have for Ember-CLI. When you do ember new <your project> to create a project then you can manually change the Ember and Ember Data dependency versions in bower.json and package.json. Make sure to update both files (for now at least) and rerun npm install and bower install in the project's root directory.
The Ember version set by default with ember-cli does not track the most recent version of Ember, but you can update to 2.x. See the changelog.
Ember itself you will interact with in the browser after running ember server and going to your localhost.

Related

Why should I use ember install over NPM or yarn?

I'm new to ember and I discover the command ember install pkg and I'm wondering why such package instead of using external package manager such as yarn or npm which are industry-wide/de-facto standard.
Question
Why should I use ember install over NPM or yarn?
ember install addon-name is a short hand for npm install --save-dev addon-name && ember g addon-name
The documentation provides the answer for this one (ctrl + f ember install):
Installs the given addon into your project and saves it to the
package.json file. If provided, the command will run the addon’s
default blueprint.
The release notes for version 0.1.5 provide a clue for this as well:
#2805 Added the install:addon command, which installs an addon with NPM and then runs the included generator of the same name if it
provides one.
So, ember install is just a replacement for npm in most cases but when a blueprint is provided it will run those as well.

What is the difference between Node Package and Bower Package?

Taking Ember App for example. ember install ember-bootstrap-4 will add node package. But bower install tether --save will add bower package. Both are part of the app. But why one is in bower and one is in npm?
npm and bower are both packages manager in your Ember application but there are some differences in using them:
Bower is only used in front-end. It will download bower package into your Ember project (bower_component folder) and you still have to add it to your app's assets. For example, if you install moment package in bower, you have to add it to your app by going to ember-cli-build.js and add the following line app.import('bower_components/moment/moment.js'); (view more details in Ember Addons and Dependencies)
NPM is used for server packages. It will download packages into node_modules project. Every ember-cli addons is in npm and when you type ember install <addons-name>, ember will look up for ember addon, place your addon's info in package.json and download it in node_modules folder. Then, Ember will load it automatically for you.
bower install - is for including run time dependencies and you need to import it in ember-cli-build.js to use.
npm install - is for including development/build time dependencies.

New Ember App with Ember 1.12.2

i want to build a new Ember CLI App with the Command: Ember new demo-app.
The Problem is, that i need Ember 1.12.2 and not the newest one.
How can i create an App with Ember 1.12.2?
Thanks a lot
Install ember-cli 0.2.7 globally
ember new demo-app
Edit your bower.json so that ember is 1.12.2 and ember-data is 1.0.0-beta.19.2
bower install
Edit your package.json so that ember-data matches version in bower.json
npm install
ember s
(Optional, but it will improve performance): Upgrade your project's ember-cli version as much as you would like to attempt. (expert step, unfortunately) (Technically it is possible to get all the way to ember-cli 2.5)
I usually use the 1.13 version from Ember CLI and downgrade Ember version to 1.12.2 in bower. It works smoothly.

How do I update ember.js to version 2.0.1

I'm fairly new to ember.js
Before starting my project I wanted to upgrade my version to the latest 2.0.1 release.
I went through the steps in the guide.
sudo npm uninstall -g ember-cli
sudo npm cache clean
bower cache clean
sudo npm install -g ember-cli
typing: ember -v gives 1.13.8 just as it did before the 'update'
I can see that the ember-cli website says 1.13.8 is the latest version of ember-cli.
However since the emberjs.com site says the latest release is 2.0.1 and on the homepage the isntruction is to run npm install -g ember-cli I would expect the command
ember -v to return 2.0.1 if I was using the latest release.
I created a new ember project using ember new test and ran
grep -r 'version' * to see if there were any clues but found nothing of interest.
Looking at package.json reveals that ember-data 1.13.8 is one of the dependencies which is also not the latest version (2.0.0)
What (if any) is the difference between ember-cli and ember.js versions?
When I type ember -v the version of which program is being displayed?
If I'm not on the latest release, how can I get it installed?
I'm running ubuntu 14.04
The current version of Ember-cli installs Ember 1.13.8. You need to update your bower.json to use the 2.0.1 version of ember.
"dependencies": {
"ember": "2.0.1",
},
and then run bower install.

How to upgrade the Ember version in an Ember CLI application?

Assuming I created this Ember application last week:
ember new shop
cd shop
ember install:addon ember-cli-scaffold
ember g scaffold product name:string
The console tells me that this application uses Ember 1.10.0:
How can I upgrade this Ember application to Ember version 1.11.0?
The syntax has been updated to:
bower install ember#2.0.0 --save-dev --save-exact
#Sukima's answer will work fine, but you can also use the ember-cli command:
ember install:bower ember#<version>
In your case, upgrading to Ember 1.11.0 would look like this:
ember install:bower ember#1.11.0
Source: http://www.ember-cli.com/#using-ember-cli
Update the version in your bower.json file and run
bower install
From ember-cli 2.11 version, ember is served from npm package, so you need to update ember-source version number in package.json
"ember-source": "~2.11.0"