gpt4 book ai didi

node.js - 是否可以在没有python的情况下为node.js安装sharp?

转载 作者:太空宇宙 更新时间:2023-11-03 23:30:24 27 4
gpt4 key购买 nike

我需要为 Node.js 安装 sharp https://github.com/lovell/sharp但它的依赖项之一(libvips)似乎需要 python(因此安装失败,因为我的系统上没有 python,并且不希望我能够在生产环境中使用 python)。

我在 sharp github 页面上读到,它指出“OS X、Windows (x64)、Linux (x64、ARM) 系统不需要安装任何外部运行时依赖项。”所以我不确定为什么我需要 python。

最佳答案

sharp 包使用node-gyp,它是一个“为 Node.js 编译 native 插件模块”的工具。通常,原生意味着 C 或 C++ 库,例如 libvips。 Node-gyp 需要 Python 2.7 才能工作,如 the install docs 中所述。 。尽管 sharp 附带了预构建的二进制文件,但它仍然需要 node-gyp(目前),如 this issue 中所述。 .

关于node.js - 是否可以在没有python的情况下为node.js安装sharp?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38987430/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com