Node-gyp 预构建安装 || node-gyp 重建与 python 3.12 一起失败

问题描述 投票:0回答:1

我正在开发一个

React Native Expo
项目,当我尝试安装或构建依赖项时,我遇到了来自node-gyp的错误。发生错误是因为node-gyp需要
Python 3.10
,但我的系统安装了
Python 3.12
。我发现使用
Python 3.10
可以解决该问题,但这并不理想,因为我的 Android 版本需要
Python 3.12.

目前,我将

Node.js v18
node-gyp 8
一起使用。这个问题有没有合适的解决办法呢?
snappy
node-sass
等软件包有时会出现此错误。任何帮助将不胜感激

/Users/XXX/Documents/my-project/node_modules/snappy: Command failed.
Exit code: 1
Command: prebuild-install || node-gyp rebuild
Arguments: 
Directory: Users/XXX/Documents/my-project/node_modules/snappy

我在 Apple Silicon 中使用 macOS Sonoma(14)

python node.js react-native npm node-gyp
1个回答
0
投票

Python312 需要 node-gyp >= 10

© www.soinside.com 2019 - 2024. All rights reserved.