npm install报错,gyp verb `which` failed Error: not found: python

news2024/11/15 19:32:45

主要错误

gyp verb which failed Error: not found: python2
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! node-sass@4.14.1 postinstall: node scripts/build.js
全部错误

gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python\n' +
gyp verb `which` failed     '    at getNotFoundError (D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158:21)',
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\graceful-fs\polyfills.js:306:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.22631
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\small software\\developer\\OpenSourceProjects\\book-v2.0\\sq-ui\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\small software\developer\OpenSourceProjects\book-v2.0\sq-ui\node_modules\node-sass
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN sass-loader@10.1.0 requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@10.1.0 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-loader@2.2.1 requires a peer of eslint@>=1.6.0 <7.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall 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\sy-sqw\AppData\Roaming\npm-cache\_logs\2024-09-15T08_49_59_575Z-debug.log

解决:

node-sass 问题

node-sass版本需与node版本对应,如下
在这里插入图片描述
可在项目根目录文件package.json中查看node-sass版本,没有请忽略

  "devDependencies": {
    "node-sass": "4.14.1",
    "sass-loader": "10.1.0"
  },

设置镜像

// 设置国内npm镜像地址
npm config set registry http://registry.npmmirror.com
// 查询npm配置
npm config list

安装编译环境

npm install -g node-gyp
// 在 Windows 上?想要编译原生 Node 模块吗?使用这一行安装构建工具。以管理员身份启动 PowerShell 并运行
npm install --global --production windows-build-tools

https://www.npmjs.com/package/windows-build-tools

卸载安装失败的包,重新安装

npm uninstall node-sass
npm install sass -i

最后

npm install

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

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

相关文章

Apisix离线安装

上传离线包 #ll apisix-3.2.2-0.el7.x86_64.rpm apisix-base-1.21.4.1.8-0.el7.x86_64.rpm apisix-dashboard-3.0.1-0.el7.x86_64.rpm cyrus-sasl-2.1.26-24.el7_9.x86_64.rpm cyrus-sasl-devel-2.1.26-24.el7_9.x86_64.rpm cyrus-sasl-gssapi-2.1.26-24.el7_9.x86_64.rpm cyr…

【H2O2|全栈】关于CSS(1)CSS基础(一)

目录 CSS基础知识 前言 准备工作 啥是CSS&#xff1f; 如何引用CSS&#xff1f; 选择器 通配符选择器 类名&#xff08;class&#xff09;选择器 id选择器 CSS解析顺序&#xff08;优先级&#xff09; 常见CSS标签&#xff08;一&#xff09; 字体属性 font-style…

spring模块(六)spring event事件(3)广播与异步问题

发布事件和监听器之间默认是同步的&#xff1b;监听器则是广播形式。demo&#xff1a; event&#xff1a; package com.listener.demo.event;import com.listener.demo.dto.UserLogDTO; import org.springframework.context.ApplicationEvent;public class MyLogEvent extends…

C#命令行参数解析库System.CommandLine介绍

命令行参数 平常在日常的开发过程中&#xff0c;会经常用到命令行工具。如cmd下的各种命令。 以下为sc命令执行后的截图&#xff0c;可以看到&#xff0c;由于没有输入任何附带参数&#xff0c;所以程序并未执行任何操作&#xff0c;只是输出了描述和用法。 系统在创建一个新…

电脑怎么恢复原来的ip地址:全面指南与注意事项

在使用电脑连接网络时&#xff0c;有时可能会因为某些原因需要更改IP地址。然而&#xff0c;在某些情况下&#xff0c;我们可能希望将电脑的IP地址恢复到原来的设置。本文将详细介绍如何恢复电脑原来的IP地址&#xff0c;并提供一些注意事项。 一、了解IP地址的分配方式 在恢复…

Linux-LVM逻辑卷管理

一、背景 Linux运维过程中大家有没有想过生产环境服务器磁盘分区如果数据量越来越膨胀(这些都是重要数据&#xff0c;不能删除)&#xff0c;那么此时如何来应对这个问题呢? 既要不影响正在运行的程序&#xff0c;同时也不能中断关机等操作。 这么一想就很蛋疼了。假设你运行…

力扣-96.不同的二叉搜索树 题目详解

题目: 给你一个整数 n &#xff0c;求恰由 n 个节点组成且节点值从 1 到 n 互不相同的 二叉搜索树 有多少种&#xff1f;返回满足题意的二叉搜索树的种数。 二叉搜索树介绍: 二叉搜索树是一个有序树&#xff1a; 若它的左子树不空&#xff0c;则左子树上所有结点的值均小于它…

凸优化学习(3)——对偶方法、KKT条件、ADMM

&#x1f345; 写在前面 &#x1f468;‍&#x1f393; 博主介绍&#xff1a;大家好&#xff0c;这里是hyk写算法了吗&#xff0c;一枚致力于学习算法和人工智能领域的小菜鸟。 &#x1f50e;个人主页&#xff1a;主页链接&#xff08;欢迎各位大佬光临指导&#xff09; ⭐️近…

【pyenv】pyenv安装版本超时的解决方案

目录 1、现象 2、分析现象 3、手动下载所需版本 4、存放到指定路径 5、重新安装 6、pip失败&#xff08;做个记录&#xff0c;未找到原因&#xff09; 7、方法二修改环境变量方法 7.1 设置环境变量 7.2 更新 7.3 安装即可 8、方法三修改XML文件 前言&#xff1a;研…

【Android】Room—数据库的基本操作

引言 在Android开发中&#xff0c;数据持久化是一个不可或缺的部分。随着应用的复杂度增加&#xff0c;选择合适的数据存储方式变得尤为重要。Room数据库作为Android Jetpack架构组件之一&#xff0c;提供了一种抽象层&#xff0c;使得开发者能够以更简洁、更安全的方式操作SQ…

PCIe进阶之TL:First/Last DW Byte Enables Rules Traffic Class Field

1 First/Last DW Byte Enables Rules & Attributes Field 1.1 First/Last DW Byte Enables Rules Byte Enable 包含在 Memory、I/O 和 Configuration Request 中。本文定义了相应的规则。Byte Enable 位于 header 的 byte 7 。对于 TH 字段值为 1 的 Memory Read Request…

【算法篇】哈希类(笔记)

目录 一、常见的三种哈希结构 二、LeetCode 练习 1. 有效的字母异位词 2. 两个数组的交集 3. 快乐数 4. 两数之和 5. 四数相加II 6. 赎金信 7. 三数之和 8. 四数之和 一、常见的三种哈希结构 当想使用哈希法来解决问题的时候&#xff0c;一般会选择如下三种数据…

java中的注解原理是什么?

Java中的注解&#xff08;Annotations&#xff09;是一种用于提供元数据的机制。它可以通过在代码中添加注解的形式&#xff0c;将一些额外的信息嵌入到代码里。注解本质上不会改变程序的实际逻辑行为&#xff0c;但是可以帮助开发工具、编译器、框架等获取这些元数据&#xff…

短信验证码倒计时 (直接复制即可使用) vue3

需求&#xff1a; 要实现一个获取验证码的需求&#xff0c;点击获取验证码60秒内不可以重复点击&#xff0c;方式有两种可以直接复制使用&#xff1b; 效果图 实现方案 方案1 (单个文件内使用比较推荐) <el-button :disabled"codeDisabled" click.stop"h…

SQL进阶的技巧:如何实现某列的累计乘积?

0 场景描述 在做数据处理的时候,尤其是复利累积的时候,有时候会有这样一场景,通过某种条件找到一列数据[X1,X2,X3...Xn],然后想要求y=X1X2X3...Xn。下面给出一个具体案例来详细解释这一问题,如下图所示,每个组的name值只有2个(2个A/B/C),当name=A or C时,price为value…

鸡蛋检测系统源码分享

鸡蛋检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Computer Vision …

python webapi上传文件

一、安装 pip install Flask 二、 编写上传文件接口webapi.py http://127.0.0.1:5000/upload from flask import Flask,request from werkzeug.utils import secure_filename import uuidapp Flask(__name__)app.route(/) def hello_world():return Hello, World!app.post(…

MySQl篇(基本介绍)(持续更新迭代)

目录 一、为什么要使用数据库 1. 以前存储数据的方式 2. 什么是数据库 3. 采用的数据库的好处 4. 如何理解数据库、数据库管理系统、SQL 5. 如何理解数据是有组织的存储 6. 现在的数据库 二、关系型数据系统 1. 什么是关系型数据库 2. 关系型数据库特点 3. 关系型数据…

p11 日志,元数据,进程的查看

直接运行docker run -d centos这个时候回启动容器&#xff0c;但是因为容器里面没有前台进程所以这个时候docker会把没用的进程给停止掉&#xff0c;可以看到docker ps命令没有查看到任何的正在运行的容器 但是如果说你使用 -it命令进入到了容器里面&#xff0c;这个他就不会…

并发编程 - 锁(属性修饰符 atomic)

引言 在多线程编程中&#xff0c;数据一致性是一个必须解决的问题。多个线程同时访问同一片共享数据时&#xff0c;极易发生竞争条件&#xff08;race conditions&#xff09;&#xff0c;导致数据的不一致性&#xff0c;甚至程序崩溃。为了解决这些问题&#xff0c;我们需要引…