栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

项目场景: gyp verb check python checking for Python executable python2 in the PATH

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

项目场景: gyp verb check python checking for Python executable python2 in the PATH

项目场景: gyp verb check python checking for Python executable “python2” in the PATH 环境

​ node v16.15.0

​ npm 8.5.5

npm install 报错


问题描述
gyp verb check python checking for Python executable "python2" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (D:demandindexnode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:demandindexnode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:demandindexnode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at D:demandindexnode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at D:demandindexnode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at D:demandindexnode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
npm ERR! gyp verb `which` failed  python2 Error: not found: python2
npm ERR! gyp verb `which` failed     at getNotFoundError (D:demandindexnode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (D:demandindexnode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (D:demandindexnode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at D:demandindexnode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at D:demandindexnode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at D:demandindexnode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb check python checking for Python executable "python" in the PATH
npm ERR! gyp verb `which` succeeded python C:Program Filespythonpython.EXE
npm ERR! gyp verb check python version `C:Program Filespythonpython.EXE -c "import platform; print(platform.python_version());"` returned: "3.8.6rn"

最开始以为是缺少python2.7

安装了 python2.7 和 windows-build-tools以后依然报错


原因分析:

node-sass和 node版本不对应

我之前的node-sass版本是4.7.2

NodeJSSupported node-sass versionNode Module
Node 177.0+102
Node 166.0+93
Node 155.0+, <7.088
Node 144.14+83
Node 134.13+, <5.079
Node 124.12+, <8.072
Node 114.10+, <5.067
Node 104.9+, <6.064
Node 84.5.3+, <5.057
Node <8<5.0<57

解决方案:

node-sass 版本修改6.0.1

在执行 npm install

解决

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/883643.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号