安装 npm 包时出现 Sharp 包错误,节点模块目录被删除

问题描述 投票:0回答:1

我有一台新电脑,安装了 Ubuntu 22.04,并且刚刚安装了节点 18.18。

现在我正在尝试安装包含 Sharp 的项目的软件包,但收到此错误:

npm ERR! code 7
npm ERR! path /home/enoch/workspace/modernminds-ic/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

npm ERR! A complete log of this run can be found in: /home/enoch/.npm/_logs/2023-10-22T07_41_53_966Z-debug-0.log
node.js npm npm-install sharp
1个回答
0
投票

Sharp 运行需要安装某些工具的安装后脚本。您很可能缺少一些依赖项,例如 node-gyp 的 python。

© www.soinside.com 2019 - 2024. All rights reserved.