当前位置: 首页 > 后端技术 > Node.js

吉普错误!找到Python解决方案

时间:2023-04-03 13:30:53 Node.js

命令运行报错如下E:\vue-admin\node_modules\fibers>ifnotdefinednpm_config_node_gyp(node"D:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js"rebuild--release)else(node"D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"rebuild--release)埃及错误!找到Pythongyp错误!查找PythonPython不是从命令行或npm配置gypERR设置的!查找PythonPython不是从环境变量PYTHONgyp设置的ERR!查找Python检查是否可以使用“python”gypERR!查找Python-“python”不在PATH中或产生了errorgypERR!查找Python检查是否可以使用“python2”gypERR!查找Python-“python2”不在PATH中或产生了errorgypERR!查找Python检查是否可以使用“python3”gypERR!查找Python-“python3”不在PATH中或产生了errorgypERR!findPython检查py启动器是否可用于查找Python2gypERR!找到Python-“py.exe”是不在PATH中或产生了errorgypERR!查找Python检查Python是否为C:\Python27\python.exegypERR!查找Python-"C:\Python27\python.exe"无法运行错误!查找Python检查Python是否为C:\Python37\python.exegypERR!查找Python-"C:\Python37\python.exe"无法运行错误!找到Pythongyp错误!找到Python*************************************************************吉普错误!找到Python需要安装最新版本的Python.gypERR!findPythonNode-gyp应该能够找到并使用Python。如果没有,gypERR!找到Python您可以尝试以下选项之一:gypERR!查找Python-使用开关--python="C:\Path\To\python.exe"gypERR!找到Python(node-gyp和npm都接受)gypERR!查找Python-设置环境变量PYTHONgypERR!查找Python-设置npm配置变量python:gypERR!找到Pythonnpmconfigsetpython"C:\Path\To\python.exe"gypERR!找Python了解更多信息co在以下位置查看文档:gypERR!找到Pythonhttps://github.com/nodejs/node-gyp#installationgyp错误!找到Python*************************************************************吉普错误!找到Pythongyp错误!配置errorgyp错误!堆栈错误:找不到任何Python安装以使用gypERR!堆栈在PythonFinder.fail(D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)gypERR!堆栈在PythonFinder.runChecks(D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)gypERR!堆栈在PythonFinder.(D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)gypERR!堆栈在PythonFinder.execFileCallback(D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)gypERR!堆栈在exithandler(child_process.js:315:5)gyp错误!堆栈在ChildProcess.errorhandler(child_process.js:327:5)gypERR!堆栈在ChildProcess.emit(events.js:314:20)错误!堆栈在Process.ChildProcess._handle.onexit(internal/child_process.js:274:12)gypERR!堆栈在onErrorNT(internal/child_process.js:468:16)gypERR!堆栈在processTicksAndRejections(internal/process/task_queues.js:80:21)gypERR!系统Windows_NT10.0.18363gyp错误!命令"D:\\nodejs\\node.exe""D:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js""重建""--释放“gypERR!cwdE:\lx-fr-admin-ui\node_modules\fibersgyp错误!节点-vv14.5.0gyp错误!节点gyp-vv5.1.0gyp错误!不是oknode-gyp退出代码:1请确保您使用的是受支持的平台和节点版本。如果您想在这台机器上编译纤程,请确保您已经设置了构建环境——Windows+OSX说明:https://github.com/nodejs/node-gypUbuntu用户请运行:`sudoapt-getinstallg++build-essential`RHEL用户请运行:`yuminstallgcc-c++`和`yumgroupinstall'开发Tools'`Alpine用户请运行:`sudoapkaddpythonmakeg++`'nodejs'不是内部或外部命令,也不是可运行的程序或批处理文件。错误!代码ELIFECYCLEnpm错误!错误号1npm错误!fibers@4.0.3安装:`nodebuild.js||nodejsbuild.js`npm错误!退出状态1npmERR!npmERR!在fibers@4.0.3安装script.npmERR时失败!这可能不是npm的问题。上面可能有额外的日志输出。npmERR!可以在以下位置找到此运行的完整日志:npmERR!D:\nodejs\node_cache\_logs\2020-07-17T00_46_32_338Z-debug.log解决方案1.安装node-gypnpminstall-gnode-gyp2.安装python推荐版本2.7(选择32位或64位安装):https://www.python.org/downlo...如果官网下载速度很慢,可以使用其他安装方式,以管理员身份执行npminstall--global--productionwindows-build-tools。安装完成后会在C:WindowsSystem32中找到一个名为.windows-build-tools的文件夹,直接根据该目录配置环境即可。为了方便,我选择重新安装python27到D盘,点击python-2.7.15.amd64.msi将其删除,然后点击安装程序。这个时候可以直接安装成功后,在命令行界面输入python测试是否安装成功3.配置环境变量环境变量->系统环境变量->Path4.npm配置npmconfigsetpython》D:\Python27\python.exe"npmconfigsetnode_gyp"D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"配置成功后,再次运行npminstall,不会报错