首页 > 编程语言 >npm i canvas 报错 canvas@2.11.2 run install node-pre-gyp install --fallback-to-build --update-binary

npm i canvas 报错 canvas@2.11.2 run install node-pre-gyp install --fallback-to-build --update-binary

时间:2024-02-21 16:35:50浏览次数:31  
标签:node canvas ERR -- python Python install gyp find

今天在写项目的时候安装npm i canvas的时候一直报错。

具体错误如下

npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build --update-binary

npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
npm ERR! node-pre-gyp info using node@16.17.0 | win32 | x64
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v93-win32-unknown-x64.tar.gz
npm ERR! node-pre-gyp ERR! install request to https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v93-win32-unknown-x64.tar.gz failed, reason: unable to verify the first certificate
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.11.2 and node@16.17.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error request to https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v93-win32-unknown-x64.tar.gz failed, reason: unable to verify the first certificate
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.17.0 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.17.0 | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack at PythonFinder.fail (C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)
npm ERR! gyp ERR! stack at PythonFinder.runChecks (C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:159:21)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18)
npm ERR! gyp ERR! stack at PythonFinder.execFileCallback (C:\Users\Administrator\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:294:16)
npm ERR! gyp ERR! stack at exithandler (node:child_process:408:5)
npm ERR! gyp ERR! stack at ChildProcess.errorhandler (node:child_process:420:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)

2.解决方法

  在网上查询了许多资料,原因是npm上无法安装canvas包,应该是因为我配置了镜像后找不到包了,最终解决问题的方法是:

npm install canvas --canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas

  如果还是不行再安装一下下面这个,之后再进行上面的步骤:

npm i -g node-gyp

 

标签:node,canvas,ERR,--,python,Python,install,gyp,find
From: https://www.cnblogs.com/lisir-blogshare/p/18025558

相关文章

  • 渲染效果图有哪几种分类?效果图云渲染更快原因
    云渲染利用了集群化的云端服务器资源,通过并行计算充分发挥了高性能硬件的优势,显著提升了渲染的速度。这一技术特别适用于处理规模庞大或细节丰富的渲染任务,在缩短项目完成时间方面表现卓越。无论是用于为建筑提供精确的可视化效果图,还是创造产品设计的详尽动态演示视频,抑或是开发......
  • 运行Xmind出现invalid configuration location报错的解决办法
    问题说明安装了XMind后,直接点击*.xmind文件,提示报错“invalidconfigurationlocation”。错误提示内容为:Theconfigurationareaat‘C:\Windows\systems.\configuration’isnotwritable.Pleasechooseawritablelocationusingthe‘-configuration’commandlineo......
  • SRM数字化采购管理平台-招投标管理系统-供应链协同|招投标|询比价(源码及功能分析)
    前言:通过数字化手段,采购管理可以更加高效、准确和透明。数字化采购管理系统可以集成各个流程环节,实现数据共享和协同工作,提高采购效率和成本控制能力。同时,数字化采购管理也有助于加强与供应商之间的沟通和协作,优化供应链管理,提升企业的竞争力。1.供应商准入:1)定义:评估供应商的......
  • Kafka-批量启动和停止Kafka节点脚本
    1、编辑脚本#!/bin/bashzookeeper_home=/usr/local/zookeeperkafka_home=/usr/local/kafkazookeeper_array=(hadoop01hadoop02hadoop03)kafka_array=(hadoop01hadoop02hadoop03)##启动和停止Zookeeperfunctionzookeeper_operate(){zookeeper_operate=$@......
  • java常量变量
    标识符标识符:给类,接口,方法,变量等起名时使用的字符序列规则:1.英文大小写构成可以有数字,下划线_和$存在规范1.不能以数字开头2.不能是Java中的关键字3.区分大小写4.要见名知意5.不要出现除了下划线_和$以外的特殊字符包(其实就是文件夹,用于解决相同类名问题)由英文小写......
  • Nginx 配置限流
    Nginx配置限流1概述2限制请求速率2.1、正常限流2.2、处理突发流量2.3、设置白名单2.4、limit_req重复3限制连接数4上传/下载速率限制4.1、limit_rate4.2、limit_rate_after4.3、proxy_limit_rate4.4、动态限速4.2、基于变量动态限速1概述限流(RateLimitt......
  • home-assistant core 源码粗读--如何管理多用户-用户存储(二)
    程序中搜索User, 很容易命中homeassistant/auth/models.py程序中大量使用了attr.s进行模型的声明。上篇说过dataclass,以及BaseModel,区别见: https://www.modb.pro/db/412679文件中定义了5个模型,这里只需要猜测他们的意思即可,这里重点分析User。程序中搜索User, 很容易命......
  • ChemDraw Pro 2022:呈现专业化学绘图的极 致之作 mac/win版
    PerkinElmerChemDrawPro2022是一款功能强大的化学绘图软件,专为化学家、科研工作者和教育者设计。这款软件凭借其卓越的性能和丰富的功能,已经成为化学绘图领域的领导者。→→↓↓载PerkinElmerChemDrawPro2022mac/win版 ChemDrawPro2022提供了广泛的化学符号和工具,使......
  • Java导入功能实现
    今天记录一下Java实现导入数据到数据,导入失败显示如下,会告诉你哪里出错了。controller代码实现@Operation(summary="导入工单")@PostMapping("/importOrderData")publicBaseResponse<String>importOrderData(@RequestParam@Parameter(name="excelFile",......
  • 《程序是怎样跑起来的》第一章第一节读后感
    在阅读了《程序是怎样跑起来的》第一章第一节之后,我有以下几点感悟:编程语言的重要性:在这一节中,作者强调了编程语言在程序运行过程中的关键作用。编程语言是程序员与计算机进行沟通的桥梁,通过编程语言,我们可以将复杂的逻辑和算法转化为计算机能理解的指令。因此,选择......