gyp ERR find Python 解决方案

article/2025/10/4 15:33:39

命令行报错如下

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://chatgpt.dhexx.cn/article/8QGIdmLK.shtml

相关文章

数据库-查询数据

查询表中所有字段数据&#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;查询满…

数据库之数据的查询

1 目的 1、理解SQL的特点&#xff1b; 2、掌握SELECT命令的使用&#xff1b; 3、掌握单表查询、连接查询、嵌套查询和集合查询&#xff1b; 4、掌握INSERT、UPDATE和DELETE命令的使用&#xff1b; 5、掌握将SQL命令嵌入到C#或其他高级语言&#xff1b; 2 要点 1、单表查询、…

【MySQL】数据库的基本查询

前言 上篇已经讲过数据库与表相关的一些相关的操作了&#xff0c;如果你对这部分依旧不太熟悉建议先去看看 传送门&#xff1a;【MySQL】逻辑库与数据表相关操作. 这篇就来说一下数据库中表的基本查询&#xff0c;看见是基本查询&#xff0c;就知道肯定有高级查询&#xff0…

SQL数据库的查询操作大全(select)

目录&#xff1a; 1、数据库的连接、创建 2、对字段的操作&#xff1a;&#xff08;alter table&#xff09; 3、对数据的操作&#xff08;插入、修改、删除&#xff09; 4、数据查询&#xff08;select&#xff09; 5、多表查询&#xff08;join on&#xff09; 6、约束…

JDK、Tomcat安装步骤

JDK安装 JDK下载地址 1.JDK安装 &#xff08;1&#xff09;运行Tomcat时需要先安装JDK&#xff0c;下载x64 installer &#xff08;2&#xff09;选择安装路径 &#xff08;3&#xff09;安装完成 2.配置环境变量 &#xff08;1&#xff09;“我的电脑”右键→属性→高级系…