报错内容

gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (E:\code\mydyh\vue-admin-pro-master\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (E:\code\mydyh\vue-admin-pro-master\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (E:\code\mydyh\vue-admin-pro-master\node_modules\graceful-fs\polyfills.js:289:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:183:21)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "D:\\ProgramFiles\\nodejs\\node.exe" "E:\\code\\mydyh\\vue-admin-pro-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\code\mydyh\vue-admin-pro-master\node_modules\node-sass
gyp ERR! node -v v14.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-05-13T10_26_43_202Z-debug.log

解决

方式一:安装python解决(正确配置系统环境变量),python(v2.7 recommended, v3.x.x is not supported) - 推荐
下载:http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi

自行下载
npm install --python=python2.7     #先下载
npm config set python python2.7   #再设置环境

方式二:先用管理员身份打开cmd - 推荐

清除npm缓存 npm cache clean --force
1.安装 npm install -g node-gyp
2.安装 npm install --global --production windows-build-tools
-报错加版本号
2.1 npm install --global --production windows-build-tools@4.0.0

默认安装路径
npm install --python=python2.7
npm config set python python2.7 如果不是默认安装
需要指定python位置:
npm config set python phthon安装路径
如npm config set python 'D:/python/python.exe'

.windows-build-tools文件夹中多了一些东西

解决

①执行npm命令npm install --global --production windows-build-tools@4.0.0
②当命令行界面开始不动时,打开任务管理器,把Build Tools结束任务(因为我没有找到BuildTolls_Full.exe)。
③再打开.windows-build-tools文件夹中的build-tools-log.txt,添加Variable: IsInstalled = 1,保存,关闭。

再看PowerShell界面

npm i安装包依赖时 gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env相关推荐

  1. error gyp ERR! stack Error: Could not find any Visual Studio installation to use

    今天安裝 npx create-react-app my-app 报错. 其他报错的方法这里就不讲了,其他好多站都有解决办法,这里把没有提到过的说下. 报错信息 gyp ERR! find VS gy ...

  2. ERR! configure error gyp ERR! stack Error: Can't find Python executable python

    Node.js 在安装模块的时候报错,缺少python环境. ERR! configure error gyp ERR! stack Error: Can't find Python executab ...

  3. gyp ERR! stack Error: Can't find Python executable 'python'

    gyp ERR! stack Error: Can't find Python executable 'python' 系统: Win10 Gatsby使用一个Starter[1]进行npm inst ...

  4. gyp ERR! stack Error: Can't find Python executable python, you can set the PYTHON env variable.

    gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env va ...

  5. gyp ERR configure error gyp ERR stack Error: Command failed: C:....

    一.问题描述 npm install 报错 二.问题原因 node.js与系统的python版本冲突 我的是Py39 三.问题解决 执行 npm config set python python2.7 ...

  6. Mac安装webpack报错gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1解决

    安装webpack ,报错提示 gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ER ...

  7. OpenBmc开发错误6:gyp ERR! configure error gyp ERR! stack Error: socket hang up

    错误提示: gyp ERR! configure error gyp ERR! stack Error: socket hang up 原因分析: 没有设置网络代理 解决方法: 进入设置,选择&quo ...

  8. gyp ERR! stack Error: EACCES: permission denied, mkdir

    1.原因 npm 出于安全考虑不支持以 root 用户运行,即使你用 root 用户身份运行了,npm 会自动转成一个叫 nobody 的用户来运行,而这个用户几乎没有任何权限.这样的话如果你脚本里有 ...

  9. VUE如何导入开源项目及报错处理gyp ERR! stack Error: Command failed: D:\Python\python.EXE -c import sys; print “%s.

    首先git项目到本地 git clone +地址 之后再用idea导入项目,先要安装依赖, npm install 但有时会报缺少Python环境的错,用cnpm解决 步骤: 安装cnpm: npm ...

最新文章

  1. 光盘在电脑上为什么放不出来_铁砂掌这么厉害,为什么上擂台用不出来
  2. 大学阶段总结——大一
  3. Matlab数组创建
  4. C#各种配置文件使用,操作方法总结
  5. AD20学习笔记5---PCB设计规则设置及PCB手工布线
  6. incc与oracle连接_Oracle 连接和会话的区别
  7. C语言实现树,你一定看得懂
  8. Q2 Spring Boot自动配置原理(ok)
  9. 一个API方式存取日志文件的模块[VB]
  10. XBMC源代码分析 6:视频播放器(dvdplayer)-文件头(以ffmpeg为例)
  11. 如何修改sql server 表中自增长ID列,因删除而不连续。可以使用临时表
  12. CTF-WEB小技俩 ——合天网安实验室学习笔记
  13. 计算机五笔是什么时候学的吗,现在学习五笔打字,还有必要吗?
  14. 【linux】按键盘Backspace键终端出现^H
  15. php博客模板源码下载,Z-BlogPHP博客学习SEM网站模板 v1.3
  16. 恋与抽卡模拟器网页_《公主连结》抽卡模拟器网站是什么 抽卡模拟器地址介绍...
  17. html实现展开余下全文多个,DIV+css内容太长,实现点击展开余下全文
  18. python甜橙歌曲音乐网站平台源码
  19. 软件在环测试 Software in-The-Loop Test
  20. 中国民族药产业“十四五”发展重点及投资商机研究报告2021-2027年

热门文章

  1. 【C语言】最佳找零组合
  2. C#的timer控件简介
  3. 游戏开发 excel导出工具
  4. 程序员要保持学习,持续学习
  5. 动态旋转变色的3D爱心
  6. 疾风之刃鸿蒙炸裂,疾风之刃二周年版本更新内容一览 疾风之刃二周年版本更新内容详解...
  7. Android RxJava操作符的学习---变换操作符---网络请求嵌套回调
  8. SIM800C天线接口设计
  9. 离散数学 - 容斥原理
  10. ftp+springboot文件传输(图片服务器配置)