mac永久配置环境变量

1. vim ~/.bash_profile
2. 配置别名
alias npm别名="/usr/local/bin/npm ----registry 镜像源"

3.vim ~/.zshrc
在最后一行添加
source ~/.bash_profile

这样即可完成配置永久别名

1. 启动终端Terminal
~/.bash_profile
No such file or directory
2. 进入当前用户的home目录
输入cd ~
3. 创建.bash_profile
输入touch .bash_profile
4. 编辑.bash_profile文件
输入open -e .bash_profile
5. 保存文件,关闭.bash_profile
6. 更新刚配置的环境变量
输入source .bash_profile

猜你喜欢

转载自www.cnblogs.com/cq1715584439/p/13392725.html