今天跑公司新项目的时候、运行前端vue、报了一个关于python的错误。就离谱

1、问题报错全部代码

actual version of core-js.
npm ERR! code 1
npm ERR! path E:\workspace\bsi-web-develop\bsi-web-develop\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:\work\nodejs\node.exe E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'E:\\work\\nodejs\\node.exe',
npm ERR! gyp verb cli 'E:\\workspace\\bsi-web-develop\\bsi-web-develop\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python2 Error: not found: python2
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed python Error: not found: python
npm ERR! gyp verb `which` failed at getNotFoundError (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed at F (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed at E (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed at E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python". checking python launcher
npm ERR! gyp verb could not find "python". guessing location
npm ERR! gyp verb ensuring that file exists: C:\Python27\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack at PythonFinder.failNoPython (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack at callback (E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
npm ERR! gyp ERR! command "E:\\work\\nodejs\\node.exe" "E:\\workspace\\bsi-web-develop\\bsi-web-develop\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd E:\workspace\bsi-web-develop\bsi-web-develop\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1 npm ERR! A complete log of this run can be found in:
npm ERR! E:\work\vue\nodejs\node_cache\_logs\2022-08-18T01_08_20_286Z-debug.log

2、问题核心部分

Can't find Python executable "python", you can set the PYTHON env variable.

npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

3、问题解决方法

首先面向百度编程

经过多次尝试自己成功解决这一问题的方法

3.1 安装编译环境(管理员身份运行)

npm install -g node-gyp
npm install --global --production windows-build-too

3.2 卸载安装失败的包

npm uninstall node-sass

3.3 重新安装包

npm install sass -i

3.3 重新 npm install

3.4 重新npm run dev

4、成功跑起来

成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.的更多相关文章

  1. 成功解决在Python文件上右键菜单无“Edit with IDLE”选项

    我电脑是Win7旗舰版,之前电脑上安装的是Python2.6版本的,前两天为了体验一下Microsoft Excel与Python之间互操作, 下载并安装了DataNitro,在安装的时候脑残的安装了 ...

  2. 解决Error: Can't find Python executable "python", you can set the PYTHON env variable

    在执行 yarn start时遇到问题, 最后一行提示 Run `npm rebuild node-sass` to download the binding for your current env ...

  3. 成功解决gyp verb ensuring that file exists: C:\Python27\python.exe gyp ERR! configure error gyp ERR! sta

    解决问题 gyp verb ensuring that file exists: C:\Python27\python.exegyp ERR! configure errorgyp ERR! stac ...

  4. Error: Can't find Python executable, you can set the PYTHON env variable.

    该错误解决方案. NodeJS安装Npm包时出现错误: npm WARN prefer global node-gyp@3.4.0 should be installed with -g > s ...

  5. Spark-shell错误:Missing Python executable 'python', defaulting to ...

    最近博主因为学习<云计算导论>一课,需要在Windows上搭建Saprk,故在网上找了相关教程搭建,步骤如下: 1. Scala 2.Spark 3.Handoop 但是不管博主怎么修正, ...

  6. Ubuntu18.0 解决python虚拟环境中不同用户下或者python多版本环境中指定虚拟环境的使用问题

    一. 不同用户下配置virtualenvwrapper的问题 问题描述: 安装virtualnev和virtualnevwrapper之后,在.bashrc进行virtualenvwrapper的相关 ...

  7. Ubuntu16.04 下 python 3.6 安装以及各版本python切换(同时解决各种依赖缺失)

    有些博客给出了从源代码通过./configure.make.sudo make 会导致安装玩之后出现各种依赖缺失的问题,如_sqlite3._bz2 等问题. 当然也有很多帖子给出了从系统自带的pyt ...

  8. 56.ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

    Node.js 在安装模块的时候报错,缺少python环境. ERR! configure error gyp ERR! stack Error: Can't find Python executab ...

  9. 2022:checking for Python executable "python2" in the PATH

    目录 一.node报错 说明 1.网上常用方法一(本博主环境无效) 2.网上常用方法二(本博主环境无效) 3.本博主使用方法(当前有效) 1.确保NodeJS环境安装没有问题,如果不会安装,请参考 构 ...

随机推荐

  1. MySQL Shell无法拉起MGR集群解决办法

    MySQL Shell无法拉起MGR集群解决办法 用MySQL Shell要重新拉起一个MGR集群时,可能会提示下面的错误信息: Dba.rebootClusterFromCompleteOutage ...

  2. Python-基础学习-第二轮

    目录 数据类型 文件 自调用其他程序 os.system函数 os.startfile 函数 subprocess 模块 线程和进程 创建新线程 共享数据的访问控制 deamon线程 多线程 JSON ...

  3. SpringCloud之Sentinel

    一. sentinel是什么? 1.概念: 分布式服务架构的流量治理组件. 2.sentinel有什么作用? 2.1 流控:QPS.线程数 2.2 熔断降级:降级-->熔断策略.时长.请求数等 ...

  4. BZOJ1305/Luogu3153 [CQOI2009]dance跳舞 (network flow)

    #define T 1001 #define S 0 struct Edge{ int nxt,pre,w; }e[500007]; int cntEdge,head[N]; inline void ...

  5. 051_末晨曦Vue技术_处理边界情况之provide和inject依赖注入

    provide和inject依赖注入 点击打开视频讲解更详细 在此之前,在我们描述访问父级组件实例的时候,展示过一个类似这样的例子: <google-map> <google-map ...

  6. 动态规划——leetcode55、跳跃游戏

    1.题目描述:  2.解题方法:动态规划 动态规划解题步骤: 1.确定状态: 最后一步:如果能跳到最后一个下标,我们考虑他的最后一步到n-1(最后一个下标),这一步是从 i 跳过来的,i<n-1 ...

  7. 【MySQL】从入门到掌握2-下载安装

    上期:[MySQL]从入门到掌握1-一些背景知识 第一章:下载 官网下载地址: https://dev.mysql.com/downloads/mysql/ https://dev.mysql.com ...

  8. 如何结合整洁架构和MVP模式提升前端开发体验 - 整体架构篇

    本文不详细介绍什么是整洁架构以及 MVP 模式,自行查看文章结尾相关链接文章. 整洁架构粗略介绍 下图为整洁架构最原始的结构图: Entities/Models:实体层,官方说法就是封装了企业里最通用 ...

  9. fastadmin后台分页设置显示方法

    ​ 1.参照日志列表的分页(后台代码都有) 2.修改默认分页配置,在初始化里面加上: pageList: [5,10,'all'], 3.显示列表: [$where, $sort, $order, $ ...

  10. KingbaseES V8R6集群同步模式synchronous参数配置详解

    如下图所示: 集群数据同步原理说明: synchronous参数配置测试: 集群节点信息: ID | Name | Role | Status | Upstream | repmgrd | PID | ...