MAC 前端准备环境
1 先看下自己的系统有没有git, 公司发的电脑很奇怪和我自己的电脑安装完全不是一回事,没有自带git,下载吧
https://git-scm.com/download/mac.
brew 没有, macports 没有, xcode 不想安装,就用二进制那个吧 Binary installer
2 下载brew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
3 下载 ITerm
brew install iTerm2.
4 安装on-my-zsh
sh -c "$(curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
或者
sh -c "$(wget https://ghproxy.com/https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
插件
brew install zsh zsh-completions
6 高亮
brew install zsh-syntax-highlightin
# 打开 .zshrc文件
vi ~/.zshrc
# 更新 plugins
plugins=(git autojump zsh-syntax-highlightin)
# 执行命令是配置文件生效
source ~/.zshrc
brew install zsh-autosuggestions
根据历史输入指令的记录即时的提示,能够很大的提高效率。
# 打开 .zshrc文件
vi ~/.zshrc
# 更新 plugins
plugins=(git autojump zsh-syntax-highlightin zsh-autosuggestions)
# 执行命令是配置文件生效
source ~/.zshrc
用到的文章
https://blog.csdn.net/qq_40603543/article/details/110522842
https://juejin.cn/post/6844903939121348616
You can install them, if desired, with: xcode-select --install
http://www.manongjc.com/detail/21-sxccghwpzxbjppj.html
https://www.jianshu.com/p/665ca10a0f5a
7git
git config --global user.name "自己的用户名"
git config --global user.email "邮箱地址"
生成密钥
ssh-keygen -t rsa -C "邮箱地址"
cat ~/.ssh/id_rsa.pub
sudo git config --system --unset credential.helper
git clone xxxxx
8nvm
8.1 Mac下nvm安装443踩坑解决
sudo vi /etc/hosts
在尾部追加内容:199.232.68.133 raw.githubusercontent.com
wq 保存
安装
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
8.2 zsh 命令行下 nvm 提示 command not found
修改 vim ~/.zshrc
文件,添加 2 行命令,然后重启命令行界面即可生效。
source ~/.bash_profile
source /etc/profile
8.3 安装node
nvm install 12.1.0
8.4 安装c n p m
npm install cnpm -g --registry=https://registry.npm.taobao.org
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构