更新时间:2023-01-14 22:32:01
1-首先,安装Homebrew.
1-First, install Homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2-然后运行brew更新以确保Homebrew是最新的.
2-Then run brew update to make sure Homebrew is up to date.
brew update
3-作为一种安全措施,应运行冲煮医生以确保系统可以冲煮.运行以下命令,并遵循Brew医生的任何建议.
3-As a safe measure you should run brew doctor to make sure your system is ready to brew. Run the command below and follow any recommendations from brew doctor.
brew doctor
4-下一步,在.bash_profile或.zshrc文件中,将Homebrew的位置添加到$ PATH中.
4-Next, add Homebrew's location to your $PATH in your .bash_profile or .zshrc file.
export PATH="/usr/local/bin:$PATH"
5-下一步,安装Node(npm将与Node一起安装):
5-Next, install Node (npm will be installed with Node):
brew install node
6-要测试您的Node和npm安装,请尝试安装Grunt(可能会要求您使用sudo运行):
6-To test out your Node and npm install, try installing Grunt (you might be asked to run with sudo):
npm install -g grunt-cli