# Install or not ember-cli globally

**URL:** <https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873>\
**Category:** Uncategorized\
**Created:** [June 1, 2018, 3:32pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873 "2018-06-01T15:32:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [June 1, 2018, 3:32pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/1 "2018-06-01T15:32:46Z")

</div>

I wonder if I need to install `ember-cli` globally before cloning an Ember project

```auto
npm install -g ember-cli

```

or it is enough to have `Yarn` installed and hit `yarn` to install the dependencies which include `ember-cli`?

---

<div class="post-metadata">

**Author:** ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)\
**Post date:** [June 1, 2018, 3:51pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/2 "2018-06-01T15:51:37Z")

</div>

The global ember-cli **always** defers to the local version of ember-cli when inside a project. The main nicety of having it installed globally is being able to run `ember` commands directly.

For yarn users, you can use `yarn ember` instead, and that works just fine…

---

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [June 1, 2018, 3:55pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/3 "2018-06-01T15:55:57Z")

</div>

Thank you for your response. I need it to know if I have to put the install command in Jenkinsfile. So as far as I understood, I don’t need to install it. Right?

---

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [June 4, 2018, 12:24pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/4 "2018-06-04T12:24:58Z")

</div>

To clear some details, if you don’t have `ember` installed globally, as @rwjblue said, you won’t be able to run any `ember` related commands. In this case, having `yarn` installed, you can run `yarn ember` to display available commands. So running `yarn ember s` would replace `ember s` command. Hope this helps.

---

<div class="post-metadata">

**Author:** ![skaterdav85](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/skaterdav85/32/18291_2.png) [@skaterdav85](https://discuss.emberjs.com/u/skaterdav85)\
**Post date:** [January 15, 2020, 11:17pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/5 "2020-01-15T23:17:28Z")

</div>

Is it possible to not defer to the local version? I tried the following and it still returns the local `ember-cli` version.

```auto
/Users/david/.nvm/versions/node/v10.15.0/bin/ember --version

```

Basically the reason I want to do this is to take advantage of the generators in 3.15, because an app I am working on is stuck on `ember-cli@3.12` due to another addon that has been deprecated. Everything else is Octane, so would be cool to leverage those generators until we can migrate away from that other addon.

---

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [January 16, 2020, 8:13am UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/6 "2020-01-16T08:13:28Z")

</div>

@skaterdav85 If I understand you right, running `ember -v` in the terminal outside of your app location will always return the global version installed:

![Screenshot 2020-01-16 at 09.10.18](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/a/3/a3876e0e70b97ec557aeb2bad3340b94ab29bb06.png)

Running the same after cd-ing to your Ember app will return the version used by your app as it is declared in the app `package.json` dependencies:

![Screenshot 2020-01-16 at 09.10.51](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/e/4/e415fdbbf2b59329870eb3c834d4b5c4c37d72c4.png)

---

<div class="post-metadata">

**Author:** ![skaterdav85](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/skaterdav85/32/18291_2.png) [@skaterdav85](https://discuss.emberjs.com/u/skaterdav85)\
**Post date:** [January 16, 2020, 6:16pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/7 "2020-01-16T18:16:14Z")

</div>

exactly. I want to use the global version for the generators since my app is stuck on the app’s version of ember-cli.

---

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [January 16, 2020, 8:59pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/8 "2020-01-16T20:59:23Z")

</div>

When you generate a new Ember app, il will always use the default Ember version set globally. In my case, it would be 3.15. If you want to upgrade your Ember app dependencies, see [EmberMap free video](https://embermap.com/video/how-to-upgrade-an-ember-app-or-addon) for more details. Hope this helps

---

<div class="post-metadata">

**Author:** ![ef4](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ef4/32/13470_2.png) [@ef4](https://discuss.emberjs.com/u/ef4)\
**Post date:** [January 17, 2020, 6:37pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/9 "2020-01-17T18:37:20Z")

</div>

@skaterdav85 you’re correct that ember-cli will work pretty hard to make sure you always get the version that is specified in your app’s own package.json. Even if you manually try to run a different version, that version will notice that it’s not the right one and invoke the other one.

> [@skaterdav85](#):
>
> an app I am working on is stuck on `ember-cli@3.12` due to another addon that has been deprecated. Everything else is Octane, so would be cool to leverage those generators until we can migrate away from that other addon.

Is the problematic addon public? Which one? It’s certainly possible to get into this situation if the addon was using private API, but it should be relatively rare because going from 3.12 to 3.15 is supposed to be fully compatible for all public APIs.

Also, are you sure the addon is incompatible with `ember-cli@3.15`, or is it really incompatible with `ember-source@3.15`? If ember-source is the problem, you can upgrade ember-cli by itself and keep ember-source at 3.12.

Also, maybe the addon isn’t really incompatible with 3.15 but it’s incompatible with some optional features that are on by default in 3.15, and you can just choose not to turn those on while upgrading.

Basically I’m asking these questions because a lot of work went into making 3.15 fully compatible, so I’m curious where the blockers are.

---

<div class="post-metadata">

**Author:** ![ef4](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ef4/32/13470_2.png) [@ef4](https://discuss.emberjs.com/u/ef4)\
**Post date:** [January 17, 2020, 6:38pm UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/10 "2020-01-17T18:38:40Z")

</div>

> [@ef4](#):
>
> Also, are you sure the addon is incompatible with `ember-cli@3.15` , or is it really incompatible with `ember-source@3.15` ? If ember-source is the problem, you can upgrade ember-cli by itself and keep ember-source at 3.12.

Oh, I should point out that if you do this, it might not solve your generators question because IIRC some of the generators come from ember-source now. The same argument also applies in reverse: you can probably upgrade ember-source but not ember-cli.

---

<div class="post-metadata">

**Author:** ![skaterdav85](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/skaterdav85/32/18291_2.png) [@skaterdav85](https://discuss.emberjs.com/u/skaterdav85)\
**Post date:** [January 18, 2020, 2:40am UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/11 "2020-01-18T02:40:56Z")

</div>

Thanks for the response @ef4!

I recently discovered that the app I am working on has a custom component blueprint. Once I deleted that, I was able to generate a Glimmer component with `ember-cli@3.12`, which is great and good for the time being.

However, the app is still stuck on 3.12. The addon that is causing problems is `ember-cli-tailwind`, which has been deprecated. Unfortunately, our app uses `ember-cli-tailwind` in the app itself and for an in-repo addon, so removing it (in favor of importing `tailwindcss` directly) isn’t trivial. We’ll have to remove it at some point though. Basically the issue is that we can’t run `ember build -prod` with `ember-cli@> 3.12`. There is actually an issue for this ([ember build -prod fails with broccoli-persistent-filter:CleanCSSFilter error · Issue #37 · embermap/ember-cli-tailwind · GitHub](https://github.com/embermap/ember-cli-tailwind/issues/37)), but since the addon is deprecated, it isn’t going to get fixed. The error we get is this:

 ![Screenshot 2020-01-15 17.58.13](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/3X/6/f/6f14d8d4aa40b523405bd95cbb48ba94e5d03980.png)

Based on my research, I think the problem might be coming from this change: [Require minify-css preprocessors to be registered externally. · ember-cli/ember-cli-preprocess-registry@5e4dea3 · GitHub](https://github.com/ember-cli/ember-cli-preprocess-registry/commit/5e4dea301eabbb1dca32bd2257426568412f90cf)

---

<div class="post-metadata">

**Author:** ![belgoros](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/belgoros/32/16101_2.png) [@belgoros](https://discuss.emberjs.com/u/belgoros)\
**Post date:** [January 19, 2020, 10:43am UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/12 "2020-01-19T10:43:20Z")

</div>

You can also take a look at how @samselikoff explains to migrate off of Ember CLI Tailwind and start working directly with the TailwindCSS npm package in [EmberMap video](https://embermap.com/video/using-postcss-and-tailwind), hope this helps.

---

<div class="post-metadata">

**Author:** ![ef4](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ef4/32/13470_2.png) [@ef4](https://discuss.emberjs.com/u/ef4)\
**Post date:** [January 21, 2020, 1:49am UTC](https://discuss.emberjs.com/t/install-or-not-ember-cli-globally/14873/13 "2020-01-21T01:49:37Z")

</div>

> [@skaterdav85](#):
>
> Unfortunately, our app uses `ember-cli-tailwind` in the app itself and for an in-repo addon, so removing it (in favor of importing `tailwindcss` directly) isn’t trivial.

That’s good news, because going from ember-cli-tailwind to directly configuring tailwind with postcss is a pretty small change, and it doesn’t depend on the size of your app (the way you write the actual app code / styles doesn’t change.)
