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. Spring boot、微服务、OAuth、OpenID的爱恨情仇!
  2. JS_01JavaScript基础笔记
  3. python定制框架知识点_python框架中flask知识点总结
  4. C语言 数组排序 – 插入法排序 - C语言零基础入门教程
  5. Python sqlalchemy orm 多对多外键关联
  6. 一道面试题:三个线程循环有序输出10次ABCABC...
  7. ShopEx 中规格属性添加时,自己主动计算其相应的销售价格,同一时候注意模板中的变量间的计算...
  8. Tableau超市案例分析
  9. 各类dp的总结+例题
  10. destoon php文件,Destoon 任意文件读取
  11. 无线通信基础知识13:数字通信之信道编码
  12. EXTRACT() 提取函数
  13. 英文文本分类实战总结
  14. CVPR读书笔记[5]:Gabor特征提取之Gabor核的实现
  15. android 监测鼠标滑轮,android2.3 监控鼠标滑动事件
  16. 根据dem提取坡度的相关问题
  17. el-input样式修改,边框,提示文字
  18. win10查看程序运行开始时间
  19. 【重识云原生】第四章云网络4.3.10.5节——VXlan组网架构
  20. 电子面单api接口_JAVA调用示例

热门文章

  1. 哪个计算机软件可以编辑动画文字,介绍一种可以编辑动态图片和文字的软件
  2. 网上支付跨行清算系统简介
  3. Metamask添加网络和切换网络
  4. 支持中文首拼 快速查询的电话本(blackberry)
  5. 迪克斯特拉(总权重最小路径)
  6. SpringBoot菜鸟教程(一)
  7. zipkin下载地址新
  8. ADB局域网连接手机进行调试项目
  9. 猿创征文|深入剖析多态的实现原理与虚函数指针
  10. python计算ema_python – 添加一个列(EMA),它是pandas中先前新列值的结果