ubuntu下Ghost无法上传图片

通过运行命令:

ghost log

发现报错如下:

[2024-12-08 21:26:01] INFO "PUT /ghost/api/admin/posts/675598c8daeb7a1bb81826ae/?formats=mobiledoc%2Clexical&save_revision=1&include=tags%2Cauthors%2Cauthors.roles%2Cemail%2Ctiers%2Cnewsletter%2Ccount.clicks%2Cpost_revisions%2Cpost_revisions.author" 200 207ms
[2024-12-08 21:26:07] INFO "GET /" 304 48ms
[2024-12-08 21:26:09] INFO "GET /xin-de-kai-shi/" 304 45ms
[2024-12-08 21:26:12] INFO "GET /pythonyu-fa-fen-xi-qi-parser-yuan-ma-yue-du-yi/" 200 43ms
[2024-12-08 21:30:16] INFO "GET /" 200 58ms
[2024-12-08 21:33:34] ERROR "POST /ghost/api/admin/images/upload/" 400 21ms

NAME: BadRequestError
MESSAGE: Image processing failed

level: normal

"Sharp wasn't installed"
"Please verify that the image is valid"
BadRequestError: Image processing failed
    at Object.query (/var/www/ghost/versions/5.104.0/core/server/api/endpoints/images.js:43:27)
    at async getResponse (/var/www/ghost/versions/5.104.0/node_modules/@tryghost/api-framework/lib/pipeline.js:259:34)
    at async ImplWrapper (/var/www/ghost/versions/5.104.0/node_modules/@tryghost/api-framework/lib/pipeline.js:264:30)
    at async Http (/var/www/ghost/versions/5.104.0/node_modules/@tryghost/api-framework/lib/http.js:70:28)

发现是sharp库没有被安装,于是安装好sharp库

npm install sharp
npm ls sharp

输出sharp的版本号代表安装正常。

注意:全程操作应都在ghost的安装目录下进行。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值