gyp ERR find Python 解决方案

news2024/9/23 11:25:20

命令行报错如下

E:\vue-admin\node_modules\fibers>if not defined npm_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 --releas
e )  else (node "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )

gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:315:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:468:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd E:\lx-fr-admin-ui\node_modules\fibers
gyp ERR! node -v v14.5.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
Alpine users please run: `sudo apk add python make g++`
'nodejs' 不是内部或外部命令,也不是可运行的程序
或批处理文件。


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fibers@4.0.3 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers@4.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\nodejs\node_cache\_logs\2020-07-17T00_46_32_338Z-debug.log

解决方案

1.安装node-gyp
npm install -g node-gyp
2.安装python

推荐安装2.7版本(自行选择32位或者64位安装):
https://www.python.org/downlo...


如果官网下载速度很慢,可以使用另一种安装方式

以管理员身份执行

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

安装完成后会在C:WindowsSystem32里找到一个名为.windows-build-tools的文件夹

 可以直接按照这个目录配置环境,为了方便,我选择将python27重装到D盘,点击python-2.7.15.amd64.msi选择

 移除之后再点击setup程序,这次可以直接安装

 

 

 

安装成功后,在命令行界面输入python测试是否安装成功

 

3.配置环境变量

环境变量->系统环境变量->Path

 4.npm 配置

npm config set python "D:\Python27\python.exe"
npm config set node_gyp "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"

配置成功后,再次运行npm install就不会报错了

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/79357.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Java项目:SSM物流快递管理系统

作者主页&#xff1a;源码空间站2022 简介&#xff1a;Java领域优质创作者、Java项目、学习资料、技术互助 文末获取源码 项目介绍 仓库管理员角色包含以下功能&#xff1a; 仓库管理员操作,入库操作,员工查看,揽收快件,新建员工等功能。 快递员角色包含以下功能&#xff1a; …

Nacos服务注册解析

服务注册就是在微服务启动时自动注册进nacos注册中心&#xff0c;核心逻辑就是在启动时调用nacos-server端的http接口:/nacos/v1/ns/instance&#xff0c;具体参考nacos官方文档。 我们打开nacos源码结构查看 上图为Nacos2.2的源码结构.其中比较核心的就是这几个包&#xff1…

墨者学院 PHP代码分析溯源(第4题) 详解

今天继续给大家介绍CTF通关writeup&#xff0c;本文主要内容是墨者学院 PHP代码分析溯源(第4题)。 免责声明&#xff1a; 本文所介绍的内容仅做学习交流使用&#xff0c;严禁利用文中技术进行非法行为&#xff0c;否则造成一切严重后果自负&#xff01; 再次强调&#xff1a;严…

尝试使用CubeMX做stm32开发之十四:FatFs的基础知识

一、文件系统概念 文件系统&#xff1a;在存储介质中建立一种组织架构&#xff0c;以更好地储存和管理数据 文件系统一般包含&#xff1a;操作系统引导区、目录、文件等 文件系统中数据以文件的形式存储 文件系统中数据的存取需要遵循特定的格式 与直接操作存储介质相比&a…

[附源码]计算机毕业设计基于SpringBt的演唱会购票系统论文2022Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

C++ MySQL Error 1366 incorrect string value引发的认识

C MySQL Error 1366 incorrect string value引发的认识 前言 在使用MySQL C API编写程序时&#xff0c;由于用到了中文&#xff0c;导致出现了MySQL error 1366 incorrect string value 问题&#xff0c;但令我同样不解的是我用同样的语句在cmd下可以正常执行。&#xff08;M…

【算法】动态规划 ⑤ ( LeetCode 63.不同路径 II | 问题分析 | 动态规划算法设计 | 代码示例 )

文章目录一、问题分析二、动态规划算法设计1、动态规划状态 State2、动态规划初始化 Initialize3、动态规划方程 Function4、动态规划答案 Answer三、代码示例LeetCode 63. 不同路径 II : https://leetcode.cn/problems/unique-paths-ii/ 一个机器人位于一个 m x n 网格的左上…

java初步学习 String(基于小李的课进行自学,初学者)12

初步学习 String 基本概念 String类型即为字符串类型&#xff0c;即“103”&#xff0c;“abc”,"小陈"等字符类型&#xff0c;在工作中可用于加密&#xff0c;替换&#xff0c;截取&#xff0c;查找等工作 不过这种名词显然不能联想到工作的实际样子 例&#xff1a;…

[附源码]Python计算机毕业设计SSM基于框架的旅游订票系统(程序+LW)

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

IIS 之 添加MIME扩展类型及HTTP错误403

IIS 之 添加MIME扩展类型及HTTP错误403 我是艾西今天跟大家分享下IIS添加MIME及HTTP报错403 经常用IIS作为下载服务器的时候有时传上去的文件比如 example.mp4 文件名上传后&#xff0c;但是用http打开的时候确显示为 404 文件不存在。其实是IIS对文件的一种保护&#xff0c;…

基于java+springboot+mybatis+vue+mysql的校园志愿者管理系统

项目介绍 本校园志愿者管理系统以springboot作为框架&#xff0c;前端vue技术&#xff0c;b/s模式以及mysql作为后台运行的数据库&#xff0c;同时使用Tomcat用为系统的服务器。本系统主要包括首页、个人中心、志愿者管理、活动类型管理、活动信息管理、活动报名管理、活动通知…

游戏开发49课 性能优化7

4. 渲染优化 渲染优化的目的是减少Draw Calls&#xff0c;减少渲染状态切换开销&#xff0c;降低显存占用&#xff0c;降低带宽和GPU负担。在讲解渲染优化之前&#xff0c;先了解渲染性能消耗点。 Draw Call数量 Draw Call有些引擎也称为SetPass Call。一个Draw Call就是游戏调…

叫ChatGPT用html+css+js写一个圣诞节代码,看看什么样子?

最近ChatGPT这么火&#xff0c;那就让他给我写点代码吧。 如何注册一个账号&#xff0c;参考&#xff1a;注册ChatGPT详细指南 注册不了的小伙伴们&#xff0c;咱们评论区见&#xff0c;问一个最想问的问题&#xff0c;看到就给你回复&#xff01; 我已经注册好了&#xff0c;…

代码随想录算法训练营第五十九天|503.下一个更大元素II、42. 接雨水

LeetCode 503.下一个更大元素II 链接&#xff1a;503.下一个更大元素II 思路&#xff1a; 本题其实和739. 每日温度更像一点&#xff0c;因为本题只有一个数组&#xff0c;而在下一个更大元素I中有两个&#xff0c;因此必须要一个哈希表来在另一个数组中查找相对应的数字。除…

yolov5检测结果不显示

安装完yolov5后&#xff0c;运行各种正常&#xff0c;后台也能显示识别信息&#xff0c;像这样。 而且在runs/detect/exp4文件夹中也会有正确的标识 但是我也想能在前台实时显示&#xff0c;像这样。 折腾了一个晚上也没有搞的定&#xff0c;甚至一度以为&#xff0c;是因为CPU…

SSM甜品店系统计算机专业毕业论文java毕业设计开题报告

&#x1f496;&#x1f496;更多项目资源&#xff0c;最下方联系我们✨✨✨✨✨✨ 目录 Java项目介绍 资料获取 Java项目介绍 计算机毕业设计java毕设之SSM甜品店系统-IT实战营_哔哩哔哩_bilibili项目资料网址: http://itzygogogo.com软件下载地址:http://itzygogogo.com/i…

【MindStudio训练营第一期】【昇腾AI训练营新手班学习笔记】可视化流程编排

准备 配置环境理解Python代码部分mxVision用户指南一份 步骤 案例的流程图&#xff1a; 图像输入和图像预处理 图像输入&#xff08;appsrc插件&#xff09; 通过python open和read到的图片数据&#xff0c;用SendData方法传入stream中&#xff0c;appsrc将数据发送给下游元…

《操作系统》期末考试卷3参考答案

《操作系统》期末考试卷&#xff08;第3套&#xff09; 参考答案与评分标准 一、单项选择题&#xff08;共10题&#xff0c;每题2分&#xff0c;共20分&#xff09; 题号 1 2 3 4 5 6 7 8 9 10 答案 D D C A C B A A B A 二、填空题&#xff08;共8题&#xff0c;每空1分&…

Java学习之toString方法

目录 toString方法的功能 Object类的toString方法 源代码 子类没有重写的案例 子类重写toString 使用AltInsert自动重写 输出结果 最后一条 例子 toString方法的功能 返回该对象的字符串表示。默认返回&#xff1a;全类名&#xff08;包名类名&#xff09;哈希值的十六进…

【云服务器 ECS 实战】ECS 快照镜像的原理及用法详解

一、ECS 快照1. 阿里云 ECS 快照概述• ECS 增量快照机制2. 快照服务的开通与使用• 开通快照与 OSS 资源包的购买• 手动快照• 自动快照二、ECS 镜像1. 阿里云 ECS 镜像概述2. 自定义镜像的创建与使用• 导入镜像• 自定义镜像一、ECS 快照 1. 阿里云 ECS 快照概述 阿里云快…