吉普错误!堆栈错误:找不到 Python 可执行文件

新手上路,请多包涵

我删除了节点模块,重新安装它,尝试安装 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

原文由 Danil Zinchenko 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 745
1 个回答

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

选项1

使用 Microsoft 的 windows-build-tools 安装所有必需的工具和配置,使用 npm install --global --production windows-build-tools 从提升的 PowerShell 或 CMD.exe( 以管理员身份运行)。

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

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

原文由 Reed Dunkle 发布,翻译遵循 CC BY-SA 4.0 许可协议

推荐问题