No command 'ember' found

让人想犯罪 __ 提交于 2019-12-04 14:56:34

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.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!