前言
编译前端项目时报错
报错
- 通过npm编译前端项目时报错:
Error: Exit code: ENOENT. spawn /usr/bin/python ENOENT
原因
dmg-builder在使用reload模块时,需要使用到Python2,没有找到Python2
解决问题
新的问题
- Mac Apple Silicon无法直接从brew安装Python2
解决问题
传送门
报错
- 通过npm编译前端项目时报错:
Electron failed to install correctly, please delete node_modules/electron and try installing again
原因
解决问题
1
| npm install electron-fix -g
|
报错
- 通过npm运行程序时报错:
SyntaxError: Unexpected token '?'
原因
解决问题
Debian
1 2
| apt remove nodejs apt remove npm
|
- 只安装npm,让npm自动下载支持的node作为依赖
完成
参考文献
Github——scowalt
CSDN——吃早餐等我
CSDN——leese233