python - 吉普错误!堆栈错误 : Can't find Python executable

标签 python node.js windows environment-variables node-gyp

我删除了 Node 模块,重新安装它,尝试安装 npm install --global node-gyp,清理了强制缓存和其他

error C:\Users\danil\work\cryptobetting\node_modules\sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\Users\danil\work\cryptobetting\node_modules\sha3
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@4.0.0
gyp info using node@10.14.2 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Programs\Python2.7\python2.7.exe", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\danil\work\cryptobetting\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\danil\work\cryptobetting\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at C:\Users\danil\work\cryptobetting\node_modules\graceful-fs\polyfills.js:282:31
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\danil\\work\\cryptobetting\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\danil\work\cryptobetting\node_modules\sha3

最佳答案

node-gyp 安装说明提供了两个选项来获取所有必需的依赖项,包括 Python 2。

Option 1

Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

npm install --global --production windows-build-tools

选项 2 是单独手动安装它们。在这里阅读所有内容:https://github.com/nodejs/node-gyp#on-windows

关于python - 吉普错误!堆栈错误 : Can't find Python executable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55908080/

相关文章:

windows - Html5 Canvas : Rotated text looks distorted on Google Chrome

python - 通过 python 将工作表添加到 ods 文件

javascript - 在 Puppeteer 中使用 page.$eval() 时如何将变量放入浏览器上下文中?

node.js - MongoDB 按月和年查找过滤器

node.js - 带有 NestJS 的 Facebook Passport

c++ - 无需重新编译或重新链接并使用 Microsoft SDK 中的命令行工具即可更改可执行文件的图标

python - Colab 中的 Cython : "cdef struct Rectangle" (line 9) identified as syntax error

python - 样本数(行)标准化的方法

python - OpenCv - 从边缘创建蒙版 - 裁剪并保存图像

c# - 如何判断一个Windows应用程序是否在屏幕外?