gyp ERR! find Python 解决方案

article/2025/10/4 15:15:04

命令行报错

npm install 
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.> heapdump@0.3.15 install D:\Work\XXX\node_modules\heapdump
> node-gyp rebuildD:\Work\XXX\node_modules\heapdump>if not defined npm_config_node_gyp (node "C:\Users\BBB\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebu
ild )  else (node "C:\Users\BBB\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
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 (C:\Users\BBB\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Users\BBB\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\BBB\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Users\BBB\AppData\Roaming\nvm\v14.20.0\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:390:5)npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! heapdump@0.3.15 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the heapdump@0.3.15 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!     C:\Users\BBB\AppData\Roaming\npm-cache\_logs\2023-03-20T08_52_13_595Z-debug.log

根据报错提示python环境问题

操作步骤

1、安装node-gyp

npm install -g node-gyp

2、安装python

https://www.python.org/download/releases/2.7/

选择2.7.0的版本
在这里插入图片描述
安装一步步操作即可

3、配置python环境变量

如果没更改路径 是在你的C盘
在这里插入图片描述
测试是否安装成功
在这里插入图片描述

4、配置环境变量

点击 我的电脑–属性–高级系统设置–环境变量–系统变量–Path --新增
在这里插入图片描述

5、npm 配置

这里我都是默认的安装路径没有改

npm config set python “C:\Python27\python.exe”
npm config set node_gyp “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js”


http://chatgpt.dhexx.cn/article/oaXgyD4G.shtml

相关文章

node-gyp 报错

error C:\xxx\node_modules\fibers: Command failed. 设置后还是会报错需要下载Visual Studio 访问地址GitHub - nodejs/node-gyp: Node.js native addon build tool 安装完之后设置使用路径就好了 npm config set msvs_version "C:\Program Files (x86)\Microsoft Visual…

【解决】gyp ERR! node -v v12.7.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

使用npm install报错如下 原因 这是 node-sass、sass-loader 安装的版本和电脑安装的 node.js 版本不兼容导致的错误 解决办法 我的node.js版本是&#xff1a;v12.7.0 在项目目的package.json文件把 node-sass 和 sass-loader 的修改成如下版本&#xff0c;npm i…

npm ERR! gyp verb等一系列错

npm ERR! code 1 npm ERR! path F:\新桌面\大三下\生产实习\mock-devices-master\mock-devices-master\node_modules\node-sass npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js npm ERR! Building: E:\Environment\Nod…

gyp ERR find Python 解决方案

命令行报错如下 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 "…

数据库-查询数据

查询表中所有字段数据&#xff1a;select * from 表名&#xff1b; 查询表中部分字段数据&#xff1a;select 字段1&#xff0c;字段2 from 表名&#xff1b; 3.运用关系运算符查询&#xff1a;select * from 表名 where 字段名 运算符 数值&#xff08;在单个字段的范围&am…

数据库查询语句

数据库查询语句无疑是所有语句中&#xff0c;最重要的语句&#xff0c;经常配合where一起使用 1. 最基本的查询 公式1&#xff1a;select * from 表名 -- 查看aaa表中的所有数据 SELECT * FROM aaa 你说&#xff0c;我不想查看表中所有的数据&#xff0c;我就想查看表中id字…

数据库查询和数据操纵

根据实验2在学生作业管理数据库Mydb中创建的学生表、课程表和学生作业表&#xff0c;进行以下操作。 使用查询语句完成以下任务&#xff08;每一个查询都要给出SQL语句&#xff0c;并且列出查询结果&#xff09;。 &#xff08;1&#xff09;查询与“张志国”同一班级的学生信息…

数据库中的数据查询

数据库中的数据查询 数据库表是存储数据库中所有数据的对象。在表中&#xff0c;数据按行和列格式逻辑组织&#xff0c;类似于电子表格。 在表中&#xff0c;每行代表一个唯一记录&#xff0c;每列代表记录中的一个字段。例如&#xff0c; SYS_User表包含用户数据&#xff0c;…

数据库---数据查询

实验目的 熟练掌握使用SQL查询语言。完成各类查询操作&#xff08;单表查询&#xff0c;连接查询&#xff0c;嵌套查询&#xff0c;集合查询&#xff09;。 实验内容 现有一个单位内部的小型图书借阅系统&#xff0c;假设每本图书的数量无限制&#xff0c;并且可以借给任何单…

MySQL数据库数据查询

1.投影查询 1.1 查询student表中所有学生的学号、姓名和专业。 1.2 查询student表中所有列。 1.3 查询student表中所有学生的学生的sno、sname、speciality&#xff0c;并将结果中各列的标题分别修改为学号, 姓名, 专业。 1.4 设student1表的表结构和样本数据与student表相同…

MYSQL介绍——数据库查询(重点)

条件查询 很多时候&#xff0c;我们使用数据库时并不是关心表里所有的数据&#xff0c;而是一部分满足条件的数据&#xff0c;这类条件要用WHERE子 句来实现数据的筛选。 SELECT …… FROM …… WHERE 条件 [ AND | OR ] 条件 …… ;下面给出一个示例&#xff1a; SELECT * …

MySQL --- 数据库查询 - 基本查询

基本查询 MySQL 数据库使用SELECT语句来查询数据。 1. 查询多个字段 以下为在MySQL数据库中查询数据通用的 SELECT 语法&#xff1a; SELECT 字段名,字段名... FROM 表名; SELECT * FROM 表名; #查询所有字段 查询语句中可以使用一个或者多个表&#xff0c…

Database:数据库查询

学习笔记&#xff1a;使用SQL语句进行数据查询 Copyright: Jingmin Wei, Pattern Recognition and Intelligent System, School of Artificial and Intelligence, Huazhong University of Science and Technology 文章目录 学习笔记&#xff1a;使用SQL语句进行数据查询准备数…

数据库查询操作

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、复杂查询的相关操作&#xff1a;二.表的设计三.聚合查询四.联合查询&#xff1a;五.外连接六.自连接七.子查询八.合并查询 前言 提示&#xff1a;这里可以…

MySQL数据库查询数据

查询数据 数据库管理系统的一个最重要的功能就是数据查询&#xff0c;数据查询不应只是简单查询数据库中存储的数据&#xff0c;还应该根据需要对数据进行筛选&#xff0c;以及确定数据以什么样的格式显示。MySQL提供了功能强大、灵活的语句来实现这些操作。 基本查询语句 mys…

数据库查询语句-详细篇

今天来梳理一下数据库的一些查询语句&#xff0c;做软件/移动端/电脑端&#xff0c;开发程序时必然离不开数据库的设计以及查询&#xff1b; 一&#xff1a;具体的代码如下展示&#xff1a; 1.查询数据库指定表的所有信息 select * from uploadimagecode;2.查询当前数据表部…

数据库的查询操作

数据库的查询操作 1 DQL_基础查询 本案例使用到SQL语句的代码如下&#xff1a; USE db1; -- 使用数据库 CREATE TABLE student ( id int, -- 编号 name varchar(20), -- 姓名 age int, -- 年龄 sex varchar(5), -- 性别 address varchar(100), -- 地址 math int, -- 数学 …

数据库-简单查询

数据库的操作无外乎是增删改查&#xff0c;那么其中的查询是我们作为测试&#xff0c;用得最多的&#xff0c;那查询应该怎么做呢&#xff0c;我们来讲解一下。 1、介绍一下我们举例的表结构 表一&#xff1a; 学生表&#xff1a;&#xff08;学号&#xff0c;姓名&#xff0…

数据库常见的查询

目录 一、查询的完全限定写法 二、条件查询 三、模糊查询 四、范围查询 1&#xff09;关键字&#xff1a;between and 2&#xff09;关键字&#xff1a;in 3&#xff09;关键字&#xff1a;is null或者、is not null和<>null和!null 五、case when 1&#xff09…

查询数据(数据库)——简单查询

目录 1&#xff0e;最简单的查询 &#xff08;1&#xff09;查询指定列 &#xff08;2&#xff09;查询所有列 &#xff08;3&#xff09;查询计算列 &#xff08;4&#xff09;为列起别名 &#xff08;5&#xff09;使用DISTINCT关键字消除重复元组 2&#xff0e;查询满…