How to upgrade your Grunt-supported Ember app to 1.9
Ember 1.9 came out a few days ago, continuing along the path towards HTMLBars.
It took me longer than the expected 5 minutes to upgrade HungryBun due to a couple of small issues regarding support for Handlebars 2 in the build tools.
I had some problems with npm when trying to update the ember-template-compiler to the latest version.
npm ERR! peerinvalid The package handlebars does not satisfy its siblings’ peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants handlebars@~2 npm ERR! peerinvalid Peer [email protected] wants handlebars@~2.0.0
npm ERR! peerinvalid The package handlebars does not satisfy its siblings’ peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants handlebars@~2 npm ERR! peerinvalid Peer [email protected] wants handlebars@~2.0.0
The problem was being caused by fixed dependencies for Handlebars defined in my package.json
It used to look like this:
"devDependencies": {
"handlebars": "~1.3.0",
"ember-template-compiler": "~1.4.0-beta.1",
"grunt-ember-templates": "~0.4.18",
}
You can safely remove all of those lines if you have them and then call
$ npm install grunt-ember-templates --save-dev
It will install the correct dependencies and result in package.json containing:
"devDependencies": {
"grunt-ember-templates": "~0.5.0-alpha"
}
Don’t forget to recompile your templates!