今天跑公司新项目的时候、运行前端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. 面向开发的内存调试神器,如何使用ASAN检测内存泄漏、堆栈溢出等问题

    GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 目录 介绍 如何使用 ASAN 检测内存泄漏 检测悬空指针访问 检测堆溢出 C++ 中的new/delete不匹配 检测栈 ...

  2. 如果Controller里有私有的方法,能成功访问吗?

    目录 背景 原因 cglib代理的锅 换成JDK动态代理呢 参考 背景 写代码的时候,复制粘贴的时候,没注意到方法的属性,就导致了Controller里有了一个私有的方法,然后访问这个接口的时候就报了 ...

  3. PyTorch中的CUDA操作

      CUDA(Compute Unified Device Architecture)是NVIDIA推出的异构计算平台,PyTorch中有专门的模块torch.cuda来设置和运行CUDA相关操作.本 ...

  4. 1.4_HTML的标签简介

    HTML 标签 HTML 标记标签通常被称为 HTML 标签 (HTML tag). HTML 标签是由尖括号包围的关键词,比如 <html> HTML 标签通常是成对!出现的,比如 &l ...

  5. 存储更弹性,详解 Fluid “ECI 环境数据访问” 新功能

    近期,Fluid 支持了阿里云 ECI 应用,并将 JuiceFS Runtime Controller 设置为默认安装:JuiceFS 也就此功能与 Fluid 完成了集成和测试工作. 用户可以在 ...

  6. 安装Windows_server_2012_r2虚拟机步骤

    创建虚拟机 使用Windows_server_2012_r2镜像 网上搜索Windows产品密钥:TVNTG-VFJQ3-FQXFP-DVCP6-D3VJ8 点击完成,等待加载 选择第二个 等待安装 ...

  7. KingbaseES 多列分区的方法与性能

    前言 对于多列分区,可以选择单级多列的范围分区,也可以选择范围加子分区的方式.但二者在不同场景下对于性能是有差异的,这里的性能差异主要是分区裁剪引起的差异. 例子 创建两张分区表,采取不同的分区策略: ...

  8. ELK接收paloalto防火墙威胁日志并定位城市展示

    ELK接收paloalto防火墙威胁日志并定位城市展示 一.准备环境: 搭建好的ELK环境 palo alto防火墙(企业用的) 二.安装logstash并做好过滤 将palo alto日志打到一台c ...

  9. Linux系统编程001--系统IO

    1. 文件系统:用来存储.组织.管理文件的一套方式.协议 2. 文件 文件的属性:i-node唯一表示一个文件的存在与否 文件的内容 3. Linux系统如何实现文件的操作? 点击查看代码 硬件层: ...

  10. 解决swiper组件autoplay报错问题

    最近在自定义一个swiper 插件 发现引用之后不定时一直在报错 Uncaught TypeError: Cannot read properties of undefined (reading 'a ...