解决gyp verb `which` failed python2 Error: not found: python2

news2024/11/29 2:45:15

运行老项目遇到如下报错

PS C:\Users\demo02> yarn install
yarn install v1.22.19
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning axios@0.18.1: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
warning element-ui > async-validator > babel-runtime > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. 
warning @babel/register > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > @hapi/joi@15.1.1: Switch to 'npm install joi'
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning @vue/cli-plugin-babel > @vue/babel-preset-app > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature 
detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > @hapi/joi > @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > @hapi/joi > @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > @hapi/joi > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > @hapi/joi > @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > @hapi/joi > @hapi/topo > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > request > har-validator@5.1.5: this library is no longer supported
warning @vue/cli-plugin-babel > @vue/cli-shared-utils > request > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning @vue/cli-plugin-babel > webpack > acorn-dynamic-import@3.0.0: This is probably built in to whatever tool you're using. If you still need it... idk
warning @vue/cli-plugin-babel > @vue/babel-preset-app > @babel/runtime-corejs2 > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the 
V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @vue/cli-plugin-babel > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning @vue/cli-plugin-babel > webpack > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @vue/cli-plugin-babel > webpack > node-libs-browser > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @vue/cli-plugin-babel > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning @vue/cli-plugin-babel > webpack > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning @vue/cli-plugin-babel > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @vue/cli-plugin-babel > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @vue/cli-plugin-eslint > eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
warning @vue/cli-plugin-eslint > babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
warning @vue/cli-plugin-eslint > eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
warning @vue/cli-plugin-unit-jest > vue-jest > extract-from-css > css > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @vue/cli-plugin-unit-jest > vue-jest > extract-from-css > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @vue/cli-plugin-unit-jest > jest > jest-cli > jest-environment-jsdom > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning @vue/cli-plugin-unit-jest > jest > jest-cli > jest-environment-jsdom > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
warning @vue/cli-plugin-unit-jest > jest > jest-cli > jest-haste-map > sane@2.5.2: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning @vue/cli-plugin-unit-jest > jest > jest-cli > jest-haste-map > sane > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning @vue/cli-plugin-unit-jest > jest > jest-cli > prompts > kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
warning @vue/cli-plugin-unit-jest > jest > jest-cli > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
warning @vue/cli-plugin-unit-jest > jest > jest-cli > jest-runtime > babel-core > babel-register > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @vue/cli-service > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning @vue/cli-service > html-webpack-plugin@3.2.0: 3.x is no longer supported
warning @vue/cli-service > webpack-dev-server > chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
warning @vue/cli-service > webpack-dev-server > webpack-log > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning @vue/cli-service > @intervolga/optimize-cssnano-plugin > cssnano-preset-default > postcss-svgo > svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning @vue/cli-service > @intervolga/optimize-cssnano-plugin > cssnano-preset-default > postcss-svgo > svgo > stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
warning babel-eslint@10.0.1: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
warning html-webpack-plugin@3.2.0: 3.x is no longer supported
warning node-sass > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning node-sass > node-gyp > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning node-sass > node-gyp > tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning runjs@4.4.2: This project has been renamed to 'tasksfile'. Install using 'npm install tasksfile' instead.
warning runjs > microcli@1.3.3: This project has been renamed to @pawelgalazka/cli . Install using @pawelgalazka/cli instead
warning runjs > microcli > microargs@1.1.2: This project has been renamed to @pawelgalazka/cli-args. Install using @pawelgalazka/cli-args instead
warning svg-sprite-loader > html-webpack-plugin@3.2.0: 3.x is no longer supported
warning svgo@1.2.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning svgo > stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
[3/5] Fetching packages...
warning url-loader@1.1.2: Invalid bin field for "url-loader".
[4/5] Linking dependencies...
warning " > less-loader@5.0.0" has unmet peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > html-webpack-plugin@3.2.0" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > sass-loader@7.3.1" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
warning " > script-ext-html-webpack-plugin@2.1.3" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0".
[5/5] Building fresh packages...
[-/5] ⢀ waiting...
[-/5] ⢀ waiting...
[3/5] ⢀ deasync
[-/5] ⢀ waiting...
error C:\Users\demo02\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Users\demo02\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\Users\demo02\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\\demo02\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@16.19.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
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 (C:\Users\demo02\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\demo02\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\demo02\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\demo02\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\demo02\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\demo02\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:202:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\Users\demo02\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\Users\demo02\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\Users\demo02\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\Users\demo02\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\Users\demo02\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\Users\demo02\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:202: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` succeeded python C:\Python311\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Python311\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:402:12)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1100:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\\demo02\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\demo02\node_modules\node-sass
gyp ERR! node -v v16.19.1

下载python

安装python

设置python环境变量

1)电脑右击——属性——高级系统设置—高级—环境变量

2)系统变量—Path 中添加环境变量 C:\Python27(python安装目录)
在这里插入图片描述

重新运行项目,大功告成

  • 今天就写到这里啦~
  • 小伙伴们,( ̄ω ̄( ̄ω ̄〃 ( ̄ω ̄〃)ゝ我们明天再见啦~~
  • 大家要天天开心哦

欢迎大家指出文章需要改正之处~
学无止境,合作共赢

在这里插入图片描述

欢迎路过的小哥哥小姐姐们提出更好的意见哇~~

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

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

相关文章

4.1.8- Web 应用程序使用的组件进行指纹识别

Web 应用程序使用的组件进行指纹识别 IDWSTG-INFO-08 总结 毫不夸张地说&#xff0c;几乎所有可以想象的Web应用程序的想法都已经投入开发。随着全球大量自由和开源软件项目的积极开发和部署&#xff0c;应用程序安全测试很可能会遇到完全或部分依赖于这些知名应用程序或框架…

vue cli npm run build打生产环境包报错Cannot read property ‘pop‘ of undefined

问题出在webpack配置的代码拆分splitChunks 解决办法&#xff1a;每个cacheGroups中配置enforce: true;

数据结构——排序算法——快速排序

快速排序算法的基本思想是 1.从数组中取出一个数&#xff0c;称之为基数&#xff08;pivot&#xff09; 2.遍历数组&#xff0c;将比基数大的数字放到它的右边&#xff0c;比基数小的数字放到它的左边。遍历完成后&#xff0c;数组被分成了左右两个区域 3.将左右两个区域视为两…

巧用Lambda表达式获取对象属性名告别魔法值

在我们日常开发中&#xff0c;使用 MyBatis-Plus 写 SQL 执行的时候&#xff0c;难免会用到表字段&#xff0c;虽然 MyBatis-Plus 提供了 LambdaQueryWrapper 帮助我们使用 Lambda 方式调用对象属性名&#xff0c;但有的时候还是不免用到魔法值&#xff0c;当对象的属性名更改了…

检索技术核心学习总结

一、学习检索技术的必要性分析 &#xff08;一&#xff09;关键原因分析 学习检索技术&#xff08;Information Retrieval&#xff0c;IR&#xff09;具有多种重要的原因&#xff0c;特别是在今天信息爆炸的数字化时代。 总的来说&#xff0c;学习检索技术有助于提高信息处理…

基于Python和mysql开发的商城购物管理系统分为前后端(源码+数据库+程序配置说明书+程序使用说明书)

一、项目简介 本项目是一套基于Python和mysql开发的商城购物管理系统&#xff0c;主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的Python学习者。 包含&#xff1a;项目源码、项目文档、数据库脚本等&#xff0c;该项目附带全部源码可作为毕设使用。 项目都经过…

Elasticsearch:什么是生成式人工智能?

生成式人工智能定义 给学生的解释&#xff08;基本&#xff09;&#xff1a; 生成式人工智能是一种可以创造新的原创内容的技术&#xff0c;例如艺术、音乐、软件代码和写作。 当用户输入提示时&#xff0c;人工智能会根据从互联网上现有示例中学到的知识生成响应&#xff0c;…

记一次线上BUG排查过程

1. 线上遇到一个非常奇怪的bug&#xff0c;为一个用户分配业务线类型后&#xff0c;该用户登录时&#xff0c;提示502&#xff0c;但其它的用户登录完全是正常的 2. 问题现象 3. 排查思路 先去看线上日志&#xff0c;看是否有error&#xff0c;但日志里边这个接口200正常返回…

业务中如何拓展微前端架构

站在整体架构的角度&#xff0c;微前端可以分为以下几类拓展迭代方向。 注册更多微应用 随着业务的扩展,我们可以在主应用中注册更多的微应用。每个微应用是一个独立的子系统,只需要在主应用的注册列表中添加新的项,配置微应用的名称、入口、活动规则等信息即可。 集成微应用…

【element-ui】el-date-picker 之picker-options时间选择区间禁用效果的实现

element-ui 时间选择器的时间区间禁用dom层引入:picker-option <el-date-pickerv-model"searchFormObj.workTime"clearablevalue-formate"yyyy-MM-dd":picker-options"pickerOptions"placeholder"请选择时间" ></el-date-pi…

应用在儿童平板防蓝光中的LED防蓝光灯珠

现在电子产品多&#xff0c;手机、平板电脑、电子书等等&#xff0c;由于蓝光有害眼睛健康&#xff0c;于是市场上有很多防蓝光的眼镜、防蓝光的手机膜、防蓝光的平板&#xff0c;这些材料和设备到底有没有用&#xff1f;如何正确预防蓝光危害呢&#xff1f; 我们现在所用的灯…

借助工业PoE交换机实现智慧停车场管理

停车场是现代城市的重要基础设施&#xff0c;而且随着汽车保有量的持续增长&#xff0c;城市中也出现了数百甚至上千停车位的大型、超大型停车场&#xff0c;而这些大型停车场的管理和服务也是一个难题。 针对大型停车场的管理&#xff0c;可以借助工业PoE交换机&#xff0c;快…

postman和node.js的使用、YApi 新版如何查看 http 请求数据

一 nodejs下载 下载链接&#xff1a; nodejs官网&#xff1a; https://nodejs.org/zh-cn/download 我使用的windows .msi安装方式&#xff0c;双击一直下一步就行 当前安装完成后的版本&#xff1a;1.下载 2.安装步骤 下载完成后&#xff0c;双击安装包&#xff0c;开始安装&…

LoGoNet:基于局部到全局跨模态融合的精确 3D 目标检测

论文地址&#xff1a;https://arxiv.org/abs/2303.03595 论文代码&#xff1a;https://github.com/sankin97/LoGoNet 论文背景 激光雷达传感器点云通常是稀疏的&#xff0c;无法提供足够的上下文来区分远处的区域&#xff0c;从而造成性能次优。 激光雷达-摄像机融合方法在三…

html网页制作期末大作业-网上花店商城html+css+javascript

一、简介 html网页制作期末大作业-网上花店商城htmlcssjavascript 8个页面适用学生作业 课程设计花店、期末作业花店、毕业设计花店 ​ 二、部分网页截图 三、部分网页源码 1. 首页代码 <!DOCTYPE html> <html lang"en"> <head><meta charse…

耐蚀合金连续油管制造工艺 学习记录

声明 本文是学习GB-T 42858-2023 耐蚀合金连续油管. 而整理的学习笔记,分享出来希望更多人受益,如果存在侵权请及时联系我们 5 制造工艺 5.1 通则 本文件所包含的合金应采用吹氧转炉冶炼或电炉冶炼或高炉冶炼(仅对马氏体或马氏体/铁素体不 锈钢)或真空感应熔化工艺&#xf…

LVS负载均衡集群--nat模式

一、集群含义&#xff1a; 由多台主机构成&#xff0c;但对外只表现为一一个整体&#xff0c;只提供一个访问入口(域名或IP地址)&#xff0c;相当于一台大型计算机。 二、群集的类型&#xff1a; 1&#xff09;负载均衡群集 LB&#xff1a; 提高系统响应效率&#xff0c;处理…

通过bid爬取b站视频内容

1.B站的视频&#xff1a;音频内容和视频内容是分开的&#xff0c;爬完之后需要进行视频合成。 2.每个b站视频的bid号都是唯一的。 3.合成视频使用ffmpeg&#xff0c;通过官网下载&#xff0c;并且pip安装对应的python包&#xff0c;pip install ffmpeg-python。 win10系统下…

导出excel单元格时实现换行

上一篇&#xff1a;laravel中安装Maatwebsite/excel扩展 承接上一篇哈&#xff0c;laravel成功安装了excel的扩展&#xff0c;但是有个小的问题&#xff0c;就是每个题目有至少两个选项&#xff0c;导出到excel的时候&#xff0c;希望每个选项之间能换行展示&#xff0c;也就是…

stu04-快速生成HTML5文档结构

1.直接输入一个英文的感叹号“!”&#xff0c;然后按Tab键&#xff0c;自动生成 2.输入“html:5”&#xff0c;然后按Tab键自动生成 3.直接复制粘贴以下代码&#xff1a; <!doctype html> <html lang"en"> <head><meta charset"UTF-8&q…