1. 安装iTerm2做终端窗口

官网地址:https://iterm2.com

2. 安装Homebrew

官网地址:https://brew.sh

  • 在命令行执行

    1. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • 在macOS Big Sur (11.1)里需要自己手工加入程序路径

    1. vi ~/.zshrc

    增加export PATH=$PATH:/opt/homebrew/bin

  • 退出并重新进入运行终端窗口程序。

3. 安装 npm

  • 到官方确认当前最新版本,地址为:https://github.com/npm/cli
  • 运行如下命令(注意变更版本号)

    1. npm install -g npm@7.6.1
  • 确认npm已经安装成功

    1. npm -v

    顺便检查一下系统自带的Node.js和git的版本号 ```shell node -v v15.11.0

git —version git version 2.24.3 (Apple Git-128)

  1. <a name="8IMIK"></a>
  2. ###
  3. - 安装cnpm
  4. ```shell
  5. $ npm install -g cnpm --registry=https://registry.npm.taobao.org
  6. $ cnpm -v
  7. $ cnpm init -y

4. 自行安装Node.js

若对已安装的node版本不满意,可以尝试用brew安装其他版本,或访问 官网 选择macOS Installer安装:
image.png

5. 安装tyarn

推荐使用 tyarn 来进行包管理,可以极大地减少 install 的时间和失败的概率,并且完全兼容 npm。如果喜欢使用 npm 而不是 yarn,可以使用 cnpm, 安装速度比 tyarn 更快,但是与 npm 不是完全兼容。

  1. #安装
  2. npm i yarn tyarn -g
  3. #检查版本
  4. tyarn -v

6. 安装Google Chrome浏览器

官网地址:https://www.google.com/intl/zh-CN/chrome/

7. 安装Visual Studio Code

官网地址:https://code.visualstudio.com

8. 安装Sublime Text文本编辑器(可选)

官网地址:https://www.sublimetext.com