Linux 出现-bash: grunt: command not found 错误解决

1、安装grunt

npm install -g grunt-cli

2、使用命令

[root@localhost ~]# grunt -version
-bash: grunt: command not found

3、分析
如果一些程序没有安装在系统默认的路径(ie /bin/, /usr/bin, /usr/local/bin/ )里面,这个时候普通用户想要调用这些命令,必须设定路径。

[root@localhost ~]# vi ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/src/node-v8.2.1-linux-x86/bin

export PATH

猜你喜欢

转载自blog.csdn.net/haoqi9999/article/details/77018585