2

I'm trying to get Ember-cli globally to the latest version so that when I run ember new it actually installs the latest version. I've followed the instructions here: https://cli.emberjs.com/release/basic-use/upgrading/

npm uninstall -g ember-cli
npm install -g ember-cli
ember --version

And the version (v2.15) does not reflect the change (v3.7). I've also checked the version just after uninstalling and it still shows up as if it hadn't been removed. I've also tried running npm cache clean after the uninstall.

I'm running ubuntu 16.04

I've also tried following the similar question here: How to upgrade ember cli version and it does NOT solve my problem.

Is there some way to select what version to use when running ember new? Or change the global version selected?

Liam
  • 27,717
  • 28
  • 128
  • 190
BrandonW
  • 268
  • 3
  • 11
  • That's weird. Could you try something like `npm install -g ember-cli@3.7`? – Cameron Jan 11 '19 at 01:42
  • 2
    Did you run the ``ember --version `` command inside an ember-cli project folder? Then it will use the projects ember-cli from ``./node_modules``. – Enno Jan 11 '19 at 09:59
  • just to piggyback on @Enno, you have to change the `package.json` version of `ember-cli` within your project. This is useful since you can run different projects with different ember cli versions – mistahenry Jan 11 '19 at 10:28
  • You might have installed ember-cli twice, once for current user and once for all users. This may happen when you change npm configuration to not require sudo. Try `which ember` after `npm uninstall -g ember-cli`. I bet it reports you some global path. Since your npm configuration is only installing (and removing) for current user, global `ember-cli` stays the same. It might even overrule installation for your user. – jelhan Jan 11 '19 at 23:42
  • whats the output of `which ember` and `ls -lisa $(which ember)`? – Lux Jan 12 '19 at 10:07
  • @Lux `which ember` /usr/local/bin/ember `ls -lisa $(which ember)` 54401770 0 lrwxrwxrwx 1 root root 39 Aug 23 2016 /usr/local/bin/ember -> ../lib/node_modules/ember-cli/bin/ember – BrandonW Jan 12 '19 at 13:59

0 Answers0