Reputation: 408
Seems like I messed up with my ember-cli install. I had installed the npm using sudo, but after reading some issues with ember-cli and sudo on npm I went for uninstall and reinstall following the instruction here https://gist.github.com/isaacs/579814.
Now I have installed ember-cli through npm install -g ember-cli
but when I do an ember new <name>
I get
No command 'ember' found, did you mean:
Command 'enber' from package 'asn1c' (universe)
ember: command not found
I can do which node
$ which node
/home/[user]/local/bin/node
and which npm
$ which npm
/home/[user]/local/bin/npm
, but I can see that ember exists in the following path that is installed:
npm install -g ember-cli
/home/[user]/npm/bin/ember -> /home/[user]/npm/lib/node_modules/ember-cli/bin/ember
Any ideas how to get ember command working?
Upvotes: 3
Views: 9444
Reputation: 198
normaly when you got this error it means you dont have ember-cli installed. or you have installed with sudo.
Upvotes: 0
Reputation: 879
The accepted answer works. Where I disagree is with using ~/.bashrc
or ~/.bash_profile
. ~/.bashrc
is used for only non-login shells and ~/.bash_profile
is used for login shells.
I advise you export to $PATH
in ~/.profile
which will be available to the whole desktop session.
Therefore, you should add something like
export PATH=$PATH:/home/[user]/npm/bin
to ~/.profile
for best results
Upvotes: 2
Reputation: 1357
Another approach is to use nvm. It gives you power to easily manage your node.js/npm versions without sudo and also manage installed packages. One drawback (or maybe not?) is that you have to install packages for each node version separately.
Upvotes: 2
Reputation: 2727
You need to make sure /home/[user]/npm/bin
is in your shell's path. You can echo $PATH
to see if it's included.
For Bash:
Add this to your .bashrc
or .bash_profile
PATH=/home/[user]/npm/bin:$PATH
And then restart your terminal or run source ~/.bashrc
For ZSH:
Add this to your '.zshrc`
path+=('/home/[user]/npm/bin')
And then restart your terminal or run source ~/.zshrc
You will need to replace [user]
in the paths with your user name on your computer.
Upvotes: 3