npm 安装前端包时python环境问题

212 阅读1分钟

如果build报错可参考:

brew install python@3.11

brew unlink python@3.13
brew link python@3.11

python3 --version

#如果需要,可以设置 npm 配置指定 Python 路径
npm config set python /usr/local/bin/python3

#如果您正在使用 node-gyp 相关的包,也可以尝试
npm config set python python3.11