今天跑公司新项目的时候、运行前端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. Eplan创建符号详细解说

    如何创建新的符号库以及在项目里面导入这个新的符号库 这个就不详细的赘述了 网上很多教程 和我一样的萌新可以参考 https://wenku.baidu.com/view/18c16641e45c3b3 ...

  2. Luogu2580 于是他错误的点名开始了 (Trie树)

    复习\(Trie\),忘了用\(val[]\)表示每个节点权值,用\(vis[]\)水过了 #include <iostream> #include <cstdio> #inc ...

  3. kubernetes之镜像拉取策略ImagePullSecrets;

    1.容器镜像是什么? 1.容器镜像(Container Image)是最终运行的软件: 2.容器镜像(最初为Docker镜像,现在叫OCI镜像更合适)是将软件打包的形式.但是容器镜像还可以携带额外的设 ...

  4. Python自学教程8-数据类型有哪些注意事项

    不知不觉,python自学教程已经更新到第八篇了,再有几篇,基本的语法就介绍完了. 今天来总结一下数据类型有哪些需要注意的地方. 元组注意事项 元组是另一种经常使用到的数据类型,看上去和列表差不多.它 ...

  5. 【C标准库】详解strerror函数

    创作不易,感谢支持 strerror 头文件:string.h 描述: strerror() 函数接受一个参数:errnum,它是一个表示错误代码的整数值.此函数将错误代码转换为说明错误的合适字符串指 ...

  6. 【JDBC】学习路径9-dbcp数据源的使用

    第一章:下载 要下载三个东西:commons pool.commons log.dbcp dbcp中有些东西是依赖于commons pool 和 commons log 的. 缺一不可,否则无法正确运 ...

  7. 并发与并行,同步和异步,Go lang1.18入门精炼教程,由白丁入鸿儒,Go lang并发编程之GoroutineEP13

    如果说Go lang是静态语言中的皇冠,那么,Goroutine就是并发编程方式中的钻石.Goroutine是Go语言设计体系中最核心的精华,它非常轻量,一个 Goroutine 只占几 KB,并且这 ...

  8. 第九十九篇:JS闭包

    好家伙,总是要来的,去面对那些晦涩难懂的原理,它就在那里,等着我去搞定它 首先我要去补充一些最基本的概念, 1.什么是内存? 新华字典永远的神, 但这个解释显然不够   去看看百度百科: 内存: CP ...

  9. 【WPF】实现动态切换语言(国际化)以及动态换肤功能

    前言:以下内容,手把手从搭建到最终实现,完成多语言切换以及换装功能. 本地系统环境:win 10 编译器环境:VS2022 社区版 .NET 环境: .NET 6 1.新建一个WPF项目 2.新建完毕 ...

  10. 4、StringBuilder类

    StringBuilder类 一个可变的字符序列,此类提供一个与StringBuffer 兼容的 API,但不保证同步(StringBuilder 不是线程安全). 该类被设计用作 StringBuf ...