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

 

posted @ 2022-06-08 14:14  梦蝶庄周  阅读(66)  评论(0编辑  收藏  举报