我正在尝试构建我的 Electron 应用程序,但遇到以下错误:
⨯ Error: Could not find any Python installation to use
...
node-gyp failed to rebuild '...node_modules\@parcel\watcher'
我尝试安装 Python、设置 ENV 变量等,但没有任何帮助。有什么建议吗?
编辑这是我的项目包文件 - 这里有任何可疑的东西吗?
package.json
{
"name": "math-wizards-desktop-app",
"private": true,
"version": "0.0.0",
"type": "module",
"main": "dist-electron/main.js",
"scripts": {
"dev:react": "vite",
"dev": "npm-run-all --parallel dev:react dev:electron",
"dev:electron": "npm run transpile:electron && cross-env NODE_ENV=development electron .",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"transpile:electron": "tsc --project src/electron/tsconfig.json",
"dist:mac": "npm run transpile:electron && npm run build && electron-builder --mac --arm64",
"dist:win": "npm run transpile:electron && npm run build && electron-builder --win --x64",
"dist:linux": "npm run transpile:electron && npm run build && electron-builder --linux --x64",
"test:e2e": "playwright test",
"test:unit": "vitest src"
},
"dependencies": {
"@tanstack/react-query": "^5.62.7",
"axios": "^1.7.9",
"clsx": "^2.1.1",
"dotenv": "^16.4.7",
"framer-motion": "^11.14.4",
"lucide-react": "^0.468.0",
"node-gyp": "^11.0.0",
"os": "^0.1.2",
"os-utils": "^0.0.14",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.4.0",
"react-responsive-masonry": "^2.6.0",
"sass": "^1.83.0",
"tailwind-merge": "^2.5.5"
},
"devDependencies": {
"@playwright/test": "^1.49.1",
"@radix-ui/colors": "^3.0.0",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^22.10.2",
"@types/os-utils": "^0.0.4",
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.11",
"@types/react-responsive-masonry": "^2.1.3",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"@vitejs/plugin-react": "^4.0.0",
"autoprefixer": "^10.4.20",
"cross-env": "^7.0.3",
"electron": "^33.2.1",
"electron-builder": "^25.1.8",
"eslint": "^8.38.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.49",
"tailwindcss": "^3.4.16",
"typescript": "^5.0.2",
"vite": "^4.3.9",
"vitest": "^2.1.8",
"windy-radix-palette": "^2.0.0-beta.7"
}
}
====================================================== =================================================== =======================================
我遇到了同样的错误,但是卸载
sass
软件包后,一切又开始工作了。