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 ...
随机推荐
- 入门 - 复习Kubernetes核心概念 (八)
本文将会简单介绍Kubernetes的核心概念.因为这些定义可以在Kubernetes的文档中找到,所以文章也会避免用大段的枯燥的文字介绍.相反,我们会使用一些图表(其中一些是动画)和示例来解释这些概 ...
- VC里打开网页
转载请注明来源:https://www.cnblogs.com/hookjc/ 1 ShellExecute 开放分类: API 编程 ShellExecute函数原型及参数含义如下: She ...
- 自定义CALayer
1.如何自定义Layer. 自定义CALayer的方式创建UIView的方式非常相似. CALayer *layer = [CALayer layer]; layer.fr ...
- uniap tab list 滑动
效果如下 <uni-popup ref="bankListAll" type="dialog"> <ty-mutiple-select :mu ...
- Go vs Java vs C# 语法对比
目录 1. 说明 2. 对比 2.1 关键字(keywords) 2.1.1 Go 2.1.2 Java 2.1.3 C# 2.1.4 小结 2.2 基本数据类型 2.2.1 Go 基本数据类型 2. ...
- python多版本切换
环境:Macbook MacOS自带的python2.7,在命令行中输入python后会显示2.7版本 如何切换成新版本? 一.修改用户配置环境变量~/.bash_profile 确定新版本的安装位置 ...
- 求解Ax=b
一 线性方程组 Ax=b 的解释 线性方程组 Ax=b,其中矩阵 A 尺寸为 m*n, 当 A 为方正时,可使用消元法判断解是否存在并求解.当 A 为长方形矩阵时,同样可使用消元法判断解存在情况并求解 ...
- Memory Management in Rust
程序在运行时需要请求操作系统分配内存以及释放内存,因此,程序员在编写程序时,需要显式(手动)地编写分配和释放内存的代码,或者隐式(自动,由语言保证)地进行内存管理.对于前者,C/C++ 是代表语言,程 ...
- 依赖于angular的table组件
组件实现了以下功能 1. 列宽可动态拖动 2. 列数据排序 3. 列过滤 4. 列位置自由调整 除了需要引入angular.js(我用的是1.4.6版本),还需要引用一个angular衍生出来的插件n ...
- leetcode算法1.两数之和
哈喽!大家好,我是[学无止境小奇],一位热爱分享各种技术的博主! [学无止境小奇]的创作宗旨:每一条命令都亲自执行过,每一行代码都实际运行过,每一种方法都真实实践过,每一篇文章都良心制作过. [学无止 ...