preface
I found that I haven’t updated my blog for more than a year (/ω \). Recently, some students asked me what environment I need to build to use Mac as a front-end. Asked the number of times, simply sorted out a set of more general and simple construction process, if it is helpful to you, welcome to like and collect ❤️~
Xcode
Essential App development and debugging tools, App Store search download
Homebrew
Homebrew is a software package management tool for The Mac OS platform. It has many useful functions, such as installing, uninstalling, updating, viewing, searching and so on.
# it is recommended to use tsinghua source/bin/ZSH - c "$(curl - fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" remember to restart the terminal # # installation is completed Verify that brew --version is installed successfullyCopy the code
iTerm2
download
A more user-friendly terminal than native bash
- To download, go to www.iterm2.com/
- Install using BREW
brew cask install iterm2
Copy the code
Switch shell
Shell CHSH -s /bin/zsh -s /bin/zsh -s /bin/zshCopy the code
Oh My Zsh
Make iTerm2’s theme more beautiful
download
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Copy the code
Set the theme
ZSH_THEME is the default theme. ZSH_THEME=" robbyRussell "# ZSH_THEME=" style name" # more themes https://github.com/ohmyzsh/ohmyzsh/wiki/Themes # remember after the modification of configuration items to make the effective source ~ /. ZSHRCCopy the code
Upgrade your own Git
# # download the brew install git configuration environment variable vim ~ /. ZSHRC # add export git = / usr/local/Cellar/git / 2.1.3 # here to write your own git version download address export $GIT/bin:$GIT/bin:$GIT/binCopy the code
Node
Download the NVM
NVM is used to manage the Node version Manager.
# # download curl - o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash configuration environment variable export NVM_DIR = "$([z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && "$NVM_DIR/ NVM. Sh "# This loads NVM # save ~/.zshrcCopy the code
M1 chip uses NVM to install an earlier version of the node error solution
M1 chip in the transition period apple gave the corresponding X86 chip compatibility scheme
Softwareupdate # install-rosetta # Install -rosetta # install the arch-x86_64 ZSH # install 14.15.0Copy the code
Control the node version with NVM (NPM is installed with node)
NVM install stable # Install the specified version NVM install <version> # Delete the specified version NVM Uninstall NVM use <version> Node # Specify the default version NVM alias default <version>Copy the code
Use YARN to download packages
Contrast yarn with NPM
brew install yarn
Copy the code
Example Set the NPM image source
# # NPM obtain image source address NPM get registry # set up the mirror source NPM set registry https://registry.npm.taobao.org # # yarn to get the mirror source address yarn config Get registry # set up the mirror source yarn config registry at https://registry.npm.taobao.orgCopy the code
A good plugin for VS Code
# Auto Close Tag # Auto Close Tag # Auto Close Tag # Auto Close Tag # Bookmarks # Static code check tool Eslint # HTML & Css related CSScomb HTML Css Support HTML Boilerplate HTML Snippets # JS related ES7 React/Redux/React-Native/JS snippets React-Native/React/Redux es6/es7 React/Redux/react-router Snippets Typescript React Open in Browser # Git wizard to view the submitter for each line of code GitLens # SVG # theme One Dark Pro # file ICONS theme vscode-iconsCopy the code