node sass
很难安装成功,编译依赖 python2,新版 mac 系统已经不带 python2,所以要先安装 python2。
brew 默认源中已经不带 python2,可以换个方式通过 pyenv 安装。
brew install pyenv
通过pyenv安装python2
arch -x86_64 pyenv install 2.7.18
加入执行路径
export PATH="$(pyenv root)/shims:${PATH}"
设置全局访问
pyenv
也可以还是通过 brew 来手动安装 python2
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/86a44a0a552c673a05f11018459c9f5faae3becc/Formula/python@2.rb
# https://cdn.wyr.me/files/2021-02-03/python@2.rb
brew install python@2.rb
rm python@2.rb
安装 node-sass
- npm
- Yarn
- pnpm
SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ npm install node-sass
SASS_BINARY_SITE=https://npm undefined
# couldn't auto-convert command.taobao.org/mirrors/node-sass/ yarn add node-sass
SASS_BINARY_SITE=https://npm undefined
# couldn't auto-convert command.taobao.org/mirrors/node-sass/ pnpm add node-sass