macOS 12.3 (21E230) Exit code: ENOENT. spawn /usr/bin/python ENOENT
相关 issues
https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1701
https://github.com/electron-userland/electron-builder/issues/6726
- 使用 python 2.7
bash
username.li@usernamelideMacBook-Pro electron-ycb % cat ~/.zshrc
export PYTHON_PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin/python
export NODE_GYP_FORCE_PYTHON="/usr/bin/python3"
export PYTHON=/Library/Frameworks/Python.framework/Versions/2.7/bin/python
# export PYTHON="/usr/bin/python3"
export PATH=$PATH:~/project/phantomjs-2.1.1-macosx/bin
username.li@usernamelideMacBook-Pro electron-ycb %
- 修改 python 相关的路径后,要立即应用
bash
source ~/.zshrc
- 删除 node_modules
bash
rm -rf node_modules
rm -rf package-lock.json
- 修改 package.json 保证 electron-builder 是^23.0.3
json
"devDependencies": {
"electron-builder": "^23.0.3",
"vue-cli-plugin-electron-builder": "~2.1.1",
},
"overrides": {
"vue-cli-plugin-electron-builder": {
"electron-builder": "^23.0.3"
}
}
- 重新开启一个新的终端
bash
npm i --ignore-engines --legacy-peer-deps
- 重新打包
bash
npm run build:x64