How to upgrade ember cli version

2020-07-09 08:35发布

问题:

I upgraded ember-cli to version 2.4.3

npm install -g ember-cli

I can see -- ember-cli@2.4.3 , in the listed dependencies, but when I check :

(master *)$ ember -v
version: 2.4.2
node: 5.6.0
os: darwin x64

ember cli version is still 2.4.2

what's wrong ?

回答1:

Updating Ember-CLI's version and ember project's version are different thing.

To update Ember-CLI:

npm uninstall -g ember-cli 
npm cache clean 
bower cache clean 
npm install -g ember-cli@1.13.14 

To update your project:

rm -rf node_modules bower_components dist tmp 
npm install --save-dev ember-cli@1.13.14 
npm install 
bower install
ember init 

Here is the resource: https://github.com/ember-cli/ember-cli/releases

I strongly recomend you to select which files will be overwritten. You should compare diffs of files. application.hbs, router.js, environment.js, ember-cli-build.js are important files those you don't want them to be overwritten.


UPDATE 2020-02-19:

ember-cli-update handles updating your project.