Ember-CLI Installation not recognized
Asked Answered
A

5

5

I have followed the following tutorial and have successfully installed everything but ember-cli. http://www.ember-cli.com/#getting-started

  • node --help (shows output help messages)
  • npm --help (shows output help messages )
  • npm install -g bower
  • npm install -g phantomjs

All the above work with no problems but when I try to ember new my-new-app I got the following

$ ember new my-new-app
-bash: ember: command not found

When I do $ npm install -g ember-cli I get the following

$ npm install -g ember-cli
/Users/MGK/.node/bin/ember -> /Users/MGK/.node/lib/node_modules/ember-cli/bin/ember
[email protected] /Users/MGK/.node/lib/node_modules/ember-cli
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], quick-         [email protected], [email protected], [email protected], [email protected])

Any ideas?

Update, here is my echo $PATH

$ echo $PATH
/Users/MGK/.rvm/gems/ruby-2.1.2/bin:/Users/MGK/.rvm/gems/ruby-2.1.2@global/bin:/Users/MGK/.rvm/rubies/ruby-2.1.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/MGK/.rvm/bin
Allonge answered 10/12, 2014 at 6:2 Comment(5)
Just to clarify, did you try ember new my-new-app again after running npm install -g ember-cli?Beetle
Yup, still getting -bash: $: command not foundAllonge
Your paths are probably screwed up. Is bower found? Check to make sure the directory containing globally-installed node modules executables is on your path.Boughton
@torazaburo That's what I was thinking. @Mills If you have trouble evaluating your path on your own, you could always update your question with the contents of echo $PATHBeetle
@torazaburo yes bower is found, @Beetle let me update my question with my echo $PATH output, thanks!Allonge
B
7

The problem is that npm's path isn't in your $PATH variable, so your shell has no idea where to look for any of your npm modules. There are a few ways to remedy this:

  1. Run npm config get prefix. Open your .bash_profile or .bashrc config file and add the following line:

    export PATH="~/.node/bin:$PATH"

    This will add your npm executables to your path. (~/.node/bin was taken from the console output when you installed ember-cli)

    Then run source ~/.bashrc or source ~/.bash_profile depending on which file you edited. This will load the changes you've made to your $PATH. Or:

  2. Run npm config set prefix /usr/local (/usr/local since you're on a Mac and it's already in your $PATH).

(See this question for a more general instance of the same npm installation issue.)

Beetle answered 13/12, 2014 at 23:44 Comment(1)
I have /usr/local as the prefix and added that to my path.. still no luckEdi
A
1

For windows users; Add your nmp path to the PATH environment variable. Start-> Advanced System Settings->Environment Variables

Under the System Variables section, click Path and then edit. Add C:\Users\username\AppData\Roaming\npm to the list. After a restart it worked for me.

Hope it helps.

Actinomycosis answered 21/3, 2020 at 15:19 Comment(1)
this worked for me. thanksCommendam
N
1

Termux

Add an Alias in ~/.profile:

alias ember="node ~/.npm-global/bin/ember"

Update configuration

source ~/.profile
Notification answered 29/10, 2024 at 20:17 Comment(0)
J
0

is there literally that giant gap (tab or spaces) in the in your path when you run $PATH?

if so, your path may be corrupt because of that whitespace. based on the PATH your provided, try doing this to reset your PATH. paste this line into your terminal window:

PATH=/Users/MGK/.rvm/gems/ruby-2.1.2/bin:/Users/MGK/.rvm/gems/ruby-2.1.2@global/bin:/Users/MGK/.rvm/rubies/ruby-2.1.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/MGK/.rvm/bin
Justinn answered 12/12, 2014 at 8:57 Comment(1)
I updated my $PATH above, the whitespace is not there anymore. Thanks for pointing that out!Allonge
L
0

As said by @wisew, the issue is that npm path not being set in the path variable!

I faced the same issue in my win7 machine, I fixed the issue by adding "C:\Users\username\AppData\Roaming\npm" to the path variable as below.

  1. open command prompt (cmd) and run setx "%path%;C:\Users\username\AppData\Roaming\npm"
  2. Reopen the cmd to confirm the changes
  3. run command ember

You should be seeing that ember command is detected now and is working :)

Thank you!

Liberticide answered 11/6, 2019 at 4:44 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.