2022:checking for Python executable "python2" in the PATH
一、node报错
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 (E:\workspace\mall\mall-admin-web\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (E:\workspace\mall\mall-admin-web\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (E:\workspace\mall\mall-admin-web\node_modules\which\which.js:80:29)
gyp verb `which` failed at E:\workspace\mall\mall-admin-web\node_modules\which\which.js:89:16
gyp verb `which` failed at E:\workspace\mall\mall-admin-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed at E:\workspace\mall\mall-admin-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:192:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (E:\workspace\mall\mall-admin-web\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (E:\workspace\mall\mall-admin-web\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (E:\workspace\mall\mall-admin-web\node_modules\which\which.js:80:29)
gyp verb `which` failed at E:\workspace\mall\mall-admin-web\node_modules\which\which.js:89:16
gyp verb `which` failed at E:\workspace\mall\mall-admin-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed at E:\workspace\mall\mall-admin-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:192:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
说明
1、网上常用方法一(本博主环境无效)
npm install --global --production windows-build-tools
- 这个的含义是在下载一个新的python,存放在本地目录下:C:\Users\A.windows-build-tools

- 如果你的机器没有装过python,那么这个命令有可能好使,但是,安装到这里的时候,它不会给你安装环境变量,你需要自己选择一下.


- 如果你本地装了python,有时候是无效的.
2、网上常用方法二(本博主环境无效)
修改本地环境变量
此电脑右键->属性->高级系统设置->环境变量->系统变量->path(添加本地的python路径)





*本博主这个环境的python,之前就是好使的,命令窗口输入python,是可以返回版本号的,但是使用Node时候,它还是不识别路径.
3、本博主使用方法(当前有效)
1、确保NodeJS环境安装没有问题,如果不会安装,请参考
构建工具(参考工具部署方式)
| 软件名称 | 版本 | 相关文章推荐 |
|---|---|---|
| NodeJS | 16.. | https://www.cnblogs.com/liuyangfirst/p/15998172.html |
2、方法一,修改配置文件,添加python环境到Node中
- 输入命令找到node的配置文件.
npm config get userconfig

- 根据输出路径,找到本地文件位置,右键以文本格式打开.


- 添加如下的路径配置.

3、方法二,命令行添加方式,添加python环境到Node中
- 输入如下命令,在命令窗口中。
npm config set python C:\Python27\python.exe

- 输入完这个命令,本质上它会将这个替你加入到配置文件中,所以,手动还是命令方式,随你喜欢。
二、node重新加载
- 执行完上述方法,如果是项目,删除项目的node_modules文件夹,重新执行。
npm install

结语
希望点赞,收藏,评论,转发,您的支持就是最快解救其他小伙伴的最好方法.
2022:checking for Python executable "python2" in the PATH的更多相关文章
- gyp verb check python checking for Python executable "python2" in the PATH
缺少python2.7支持 可快速使用以下语句完成安装 npm install --global --production windows-build-tools 到时候会自动下载python的 如果 ...
- 成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
今天跑公司新项目的时候.运行前端vue.报了一个关于python的错误.就离谱 1.问题报错全部代码 actual version of core-js. npm ERR! code 1 npm ER ...
- 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 ...
- 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 ...
- Spark-shell错误:Missing Python executable 'python', defaulting to ...
最近博主因为学习<云计算导论>一课,需要在Windows上搭建Saprk,故在网上找了相关教程搭建,步骤如下: 1. Scala 2.Spark 3.Handoop 但是不管博主怎么修正, ...
- 解决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 ...
- python内置模块[sys,os,os.path,stat]
python内置模块[sys,os,os.path,stat] 内置模块是python自带功能,在使用内置模块时,需要遵循 先导入在 使用 一.sys 对象 描述 sys.argv 命令行参数获取,返 ...
- Bison executable not found in PATH by mysql install
[root@luozhonghua mysql-5.5.21]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/d ...
- Python join() 方法与os.path.join()的区别
Python join() 方法与os.path.join()的区别 pythonJoinos.path.join 今天工作中用到python的join方法,有点分不太清楚join() 方法与os.p ...
随机推荐
- git每次操作都要输入账号密码 解决方案
1.执行命令: git config --global credential.helper store git pull 2.输入用户名密码,以后就不会再次要求用户名密码了
- 长安战疫Wp
长安战疫wp misc 八卦迷宫 直接走迷宫 cazy{zhanchangyangchangzhanyanghechangshanshananzhanyiyizhanyianyichanganyang ...
- 文本处理命令(sort+uniq+cut+tr+wc)+三剑客之sed
目录 文本处理命令+三剑客之sed 一.文本处理命令 1.排序命令 sort 2.检查/删除命令 uniq 3. cut 显示特定部分命令 4. 替换或删除命令 tr 5.统计 计算数字命令 wc 二 ...
- 私有化轻量级持续集成部署方案--06-私有镜像仓库-Harbor
提示:本系列笔记全部存在于 Github, 可以直接在 Github 查看全部笔记 针对私有镜像仓库的问题,Docker 官方提供了搭建仓库服务的镜像服务:registry,使用此镜像就可以部署私有仓 ...
- 金融行业BI可视化报表,直观体验数据的价值
现在,数据已成为非常重要的资产.之前,人们只是把它当作一种附属品,由客户来办理业务,在系统中产生了这样的附属品.但如今,发现在客户办理业务这一信息中,蕴藏着一些客户的需求,积聚成千条这种信息,可以洞察 ...
- 传统式BI工具和自助式BI工具到底有什么区别
相信很多人都听说过BI工具,但是你听说过自助BI工具吗?自助式BI工具面向没有IT背景的业务分析师,比传统的BI工具灵活易用,在一定程度上摆脱了对IT部门的大幅度依赖,使数据产品链更加大众化,更加理解 ...
- 【C# .Net GC】垃圾回收算法 应用程序线程运行时,
触发垃圾回收算法的条件 触发垃圾回收的条件 当满足以下条件之一时将发生垃圾回收: 操作系统报告低内存请看(将触发第2代垃圾回收). 这是通过 OS 的内存不足通知或主机指示的内存不足检测出来. 由托管 ...
- win7下安装Hadoop
1 下载准备 下载hadoop,官网用一个快一点的镜像,使用迅雷加速下载,二进制格式,解压目录:E:\hadoop\hadoop-2.9.2 下载winutils,这个是别人编译好的hadoop的wi ...
- 2020ICPC南京 M.Monster Hunter
题目大意 一颗根为 \(1\) 的有 \((2≤≤2000)\) 个节点的树,每个节点有一个权值 \(ℎ_{} (1≤ℎ_{}≤10^9)\) ,能删除某个点的前提是其父亲节点已经被删除,并且删除一个 ...
- Android studio常用快捷键导包的设置
下面是一些快捷键的使用还有快速导包的设置 1. Ctrl+G 同时按下Ctrl+G快捷键弹出快速定位框,在框中输入行数点击OK即可快速切换到对应的行数,如图2.17所示. 2. Ctrl+E 同时按下 ...