npm install 报错:gyp verb `which` failed Error: not found: python

2023-05-16

今天新启动一个项目,在 npm install 安装依赖项时出现报错。

$ npm install

> husky@0.14.3 install D:\programs\rubik-web\node_modules\husky
> node ./bin/install.js

husky
setting up Git hooks
done


> node-sass@4.14.1 install D:\programs\rubik-web\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-83_binding.node":

read ECONNRESET

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> core-js@2.6.11 postinstall D:\programs\rubik-web\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> ejs@2.7.4 postinstall D:\programs\rubik-web\node_modules\ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)


> node-sass@4.14.1 postinstall D:\programs\rubik-web\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe D:\programs\rubik-web\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'D:\\programs\\rubik-web\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@14.5.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
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 (D:\programs\rubik-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\programs\rubik-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\programs\rubik-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (D:\programs\rubik-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\programs\rubik-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\programs\rubik-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\programs\rubik-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\programs\rubik-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\programs\rubik-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (D:\programs\rubik-web\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (D:\programs\rubik-web\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (D:\programs\rubik-web\node_modules\which\which.js:80:29)
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\which\which.js:89:16
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at D:\programs\rubik-web\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:176:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
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 (D:\programs\rubik-web\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\programs\rubik-web\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (D:\programs\rubik-web\node_modules\graceful-fs\polyfills.js:295:20)
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:176:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\programs\\rubik-web\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\programs\rubik-web\node_modules\node-sass
gyp ERR! node -v v14.5.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.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 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\wangdan11\AppData\Roaming\npm-cache\_logs\2020-07-21T06_55_31_581Z-debug.log

有问题,网上找,你踩的坑,前辈们应该早就踩过。

最终解决方案为:

npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
npm install node-sass
npm install

OK,搞定了。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

npm install 报错:gyp verb `which` failed Error: not found: python 的相关文章

随机推荐

  • FreeRTOS源码解析——第二章 编程规范

    FreeRTOS源码解析 第一章 FreeRTOS 整体架构 第二章 FreeRTOS 编程规范 第三章 FreeRTOS 内存管理 第三章 FreeRTOS 内存管理 第四章 FreeRTOS 任务管理 第五章 FreeRTOS 消息队列
  • FreeRTOS源码解析——第三章 内存管理

    FreeRTOS源码解析 第一章 FreeRTOS 整体架构 第二章 FreeRTOS 编程规范 第三章 FreeRTOS 内存管理 第四章 FreeRTOS 任务管理 第五章 FreeRTOS 消息队列 第六章 FreeRTOS 软件定时
  • sonic编译过程

    文章目录 1 0虚拟机选择2 0虚拟机安装3 0 系统配置4 0 安装docker5 0 安装sonic 1 0虚拟机选择 原则上所有的系统都可以编译sonic xff0c 此处我们选择centos 7 7 xff0c 虚拟机的内存空间建议
  • Sonic测试架构介绍

    Sonic项目简介 Sonic Software for Open Networking in the CloudSonic是基于Linux的开源网络操作系统 xff0c 可以跑在多个不同芯片厂商交换机上Sonic在2016年OCP峰会上
  • Sonic_cli常用命令

    用户名 xff1a admin 密码 xff1a YourPaSsWoRd 一 change password admin 64 sonic passwd Changing password for admin current UNIX p
  • SONIC config_db.json文件的前生今世

    config db json的使用 系统启动时从config db json中读取数据并写入CONFIG DB数据库 xff0c 前提是config db json存在 xff1b 保存当前系统的一些配置信息 xff0c 通过config
  • SONiC架构DOCKER组件交互分析

    BGP组件交互分析 内核中的bgp socket收到BGP更新报文 xff0c 然后被上送到bgpd进程bgpd处理该报文 xff0c 并通知zebra进程新增前缀和关联下一跳zebra确定该目的可达后 xff0c 生成一个路由网络链接信息
  • sonic处理netlink事件

    sonic处理netlink事件 sonic在处理路由 xff0c 接口up down 接口地址变化 xff0c team等事件上极大的依赖内核 sonic通过监听rtnl事件来响应linux事件 从而感知相关信息变化 libnl soni
  • sonic配置team与实现机制

    sonic实现team代码框架图 xff1a sonic修改lag模式配置步骤 1 修改文件teamd j2 docker exec it teamd bash cd usr share sonic templates vim teamd
  • asyncComputed 异步计算属性

    asyncComputed 异步计算属性 我们项目中最近使用了异步计算属性 xff0c 个人感觉很好用 xff0c 特此推荐给大家 一 案例 假设这样一个场景 xff1a 一个列表数据 data 是通过接口返回 xff0c 请求参数中有一个
  • sonic管理口信息处理流程

    sonic管理口信息处理流程 管理接口信息配置文件格式 管理信息使用MGMT INTERFACE 表进行配置 对象的key由管理接口名字和IP前缀使用 连接而成 属性 gwaddr用于执行默认路由指向管理口 xff0c 其值为默认网关 属性
  • SONIC VLAN配置流程

    SONIC VLAN配置流程 sonic vlan配置通过订阅config db的键空间事件完成vlan配置信息从config db到内核和硬件 config db json格式如下 xff1a 34 VLAN 34 34 Vlan1000
  • sonic容器构建

    sonic中大量的组件运行在docker容器中 xff0c 用于隔离彼此的运行环境 xff0c 从而解决相互之间的互斥问题 下面我们分析一下sonic中各个容器的构建过程 Dockerfile文件的生成过程 sonic中的容器Dockerf
  • ARM Cortex-M底层技术(九)KEIL MDK 分散加载示例1-更改程序运行基址

    KEIL MDK 分散加载示例1 更改程序运行基址 小编我一向主张在实战中学习 xff0c 不主张直接去去学习规则 amp 定义 xff0c 太枯燥 xff0c 在实际应用中去摸索 xff0c 才会真正理解具体的技术细节 xff0c 下面我
  • 如何修改已提交commit信息

    如何修改已提交commit信息 1 修改commit信息 1 1 修改最后一次提交信息 通过git log查看提交历史信息 xff1a 输入命令 xff1a span class token function git span commit
  • linux 安装mysql 以及常见错误总结

    安装的方法菜鸟教程上有 xff1a 入口 mysqld initialize 命令是出现如下错误Fatal error Please read 34 Security 34 section of the manual to find out
  • elementui下拉框多选报[Vue warn]: <transition-group> children must be keyed: <ElTag>

    elementui下拉框多选 xff0c 选值报错 选中一个值后所有的值都会被选中 经检查 xff0c 是由于我的下拉框的value值为一个对象而非单个值 值为对象时需要填入value key span class token operat
  • Hadoop_1 入门WordCount

    记录踩得坑以及部署环境流程 搭建的是伪分布Hadoop 首先环境需要安装zookeeper 这个好装 xff0c 不多说其次比较复杂的是安装openssh 我的Linux系统是centos 7 mini版本 安装openssh之前的准备工作
  • PX4无人机控制

    PX4无人机控制 向话题 mavros setpoint raw local发布无人机目标位置 43 偏航 xff0c 或者目标速度 43 偏航 发布目标位置 43 偏航 xff1a mission span class token pun
  • npm install 报错:gyp verb `which` failed Error: not found: python

    今天新启动一个项目 xff0c 在 npm install 安装依赖项时出现报错 npm install span class token operator gt span husky 64 span class token number