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

系统: Win10

Gatsby使用一个Starter[1]进行npm install的时候出现问题:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (G:\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:101:14)
gyp ERR! stack     at G:\nodejs\node_modules\npm\node_modules\node-gyp\lib\confi
gure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "G:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\
bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\system32\node_modules\caress-server\node_modules\buffert
ools
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! buffertools@2.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the buffertools@2.0.1 install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.

Root Cause

Some npm plugins need node-gyp to be installed.

However, node-gyp has it's own dependencies

反正就是一系列的组件没安装呗.

注意: 这玩意不支持Python 3.0, 因此只能安装2.7

Solution Step 1

Stackoverflow找到的第一个答案[2]:

管理员执行:

$ npm install --global --production windows-build-tools

然后执行:

$ npm install --global node-gyp

Solution Step 2

然鹅上面的Solution似乎对我的电脑无用啊...

可能需要手动设置[3]

npm config set python python2.7
npm config set msvs_version 2015

我不确定这样的设置是否会影响到runtime, 因此我顺手再设置了一个环境变量

PYTHON = C:\Users\Zill.windows-build-tools\python27\python.exe

注意这儿需要详细到文件名

然后就解决了

gyp ERR! stack Error: Can't find Python executable 'python'相关推荐

  1. 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 ...

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

    报错内容 gyp verb ensuring that file exists: C:\Python27\python.exe gyp ERR! configure error gyp ERR! st ...

  3. 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 ...

  4. 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 ...

  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. 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 ...

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

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

最新文章

  1. Apache 配置关闭文件目录浏览
  2. 对时域连续信号用matlab离散,数字信号处理上机实验一 离散时间信号的时域分析...
  3. UVALive7670 Asa's Chess Problem,上下界费用流,另类解法
  4. ffmpeg - AVPacket内存问题分析(AVFrame一样的)
  5. 乐山市计算机学校太坑,乐山市计算机学校小规矩成就大素养
  6. d3.js html显示图片,d3.js v4:如何在鼠标点击节点后显示图像
  7. 今天react开发遇到个比较恶心的问题
  8. 人工智能与深度学习概念(3)——目标分类-CNN
  9. NAACL2021 | 苏大阿里提出:一种统一的基于跨度的意见挖掘方法
  10. WPF 获取程序路径的一些方法,根据程序路径获取程序集信息
  11. 大数据工程师简历怎么写,更受到HR青睐?
  12. python词云图生成
  13. Linux下软连接(softlink)和硬连接(hardlink)的区别
  14. 弗吉尼亚大学计算机就业如何,假设你是新华中学的学生李华,高中毕业后想到美国弗吉尼亚大学(University of Virginia)计算机专业深造...
  15. Linux文件管理之(高级)、⽂件查找、上传与下载、输出与重定向、字符处理命令、打包压缩解压缩、文件系统
  16. VMware虚拟机更改静态IP报错Unit network.service entered failed state解决方案
  17. java计算机毕业设计无线通信基站监控及管理系统源码+系统+数据库+lw文档+mybatis+运行部署
  18. ant pro-table点击表格行高亮显示
  19. 徐志果:创业就是遇见更好的自己(我的成长之路)
  20. linux中tftp服务器设置及测试

热门文章

  1. python eye 函数用法
  2. 【微信电子画册制作】名编辑电子杂志大师教程 | 给电子杂志设置背景图片
  3. HTML5七夕情人节表白网页制作【css3爱心表白背景特效】HTML+CSS+JavaScript 520情人节代码制作
  4. sendmail 使用外部 smtp 服务发送邮件
  5. javascript工具类函数
  6. 微博 - 如何修改微博昵称?
  7. AndroidX深入浅出Jetpack全面介绍
  8. 动态gif图片如何在线做?轻松实现图片在线生成gif
  9. IE6下载文件名过长导致乱码问题的解决方案
  10. 光学三角法知识点总结