使用 plasmo 时报错如下:
E:\chromeplugins>pnpm create plasmo
../.pnpm-store/v3/tmp/dlx-46852 | +2 +
../.pnpm-store/v3/tmp/dlx-46852 | Progress: resolved 2, reused 2, downloaded 0, added 2, done
Plasmo v0.83.0
The Browser Extension Framework
Extension name: myExtension3
Extension description: just for fun
Author name: mike gao
INFO | Creating new project with popup
INFO | Installing dependencies...
WARN 1 deprecated subdependencies found: [email protected]
Packages: +560
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 634, reused 559, downloaded 0, added 560, done
node_modules/.pnpm/[email protected]/node_modules/sharp: Running install script, failed in 2.8s
.../[email protected]/node_modules/sharp install$ (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp …
│ sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.4/libvips-8.14.4-win32-x64.tar.br
│ sharp: Installation error: unable to verify the first certificate
│ sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
└─ Failed in 2.8s at E:\chromeplugins\my-extension3\node_modules\.pnpm\[email protected]\node_modules\sharp
ELIFECYCLE Command failed with exit code 1.
重点是这行:sharp: Installation error: unable to verify the first certificate
可知是安装sharp 有问题。
打开提示中的文档:
sharp - High performance Node.js image processing