梦想与想象
梦想与想象
  • 发布:2022-08-13 01:41
  • 更新:2024-05-04 15:50
  • 阅读:711

腾讯云空间安装依赖sharp报错

分类:uniCloud
//引入这个就会报错,本地已经安装依赖了,本地运行正常,上传到云报错  
const sharp = require("sharp");

package.json如下图

报错内容:

2022-08-12T17:33:42.714Z      
    Something went wrong installing the "sharp" module  
    Cannot find module '../build/Release/sharp-linux-x64.node'  
    Require stack:  
    - /var/user/node_modules/sharp/lib/sharp.js  
    - /var/user/node_modules/sharp/lib/constructor.js  
    - /var/user/node_modules/sharp/lib/index.js  
    - /var/user/service/client/face/kh/face.js  
    - /var/user/config.js  
    - /var/user/__index.js  
    - /var/user/index.js  
    - /var/runtime/node12/UserFunction.js  
    - /var/runtime/node12/Runtime.engine.js  
    - /var/runtime/node12/bootstrap.js  
    Possible solutions:  
    - Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"  
    - Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"  
    - Consult the installation documentation: https://sharp.pixelplumbing.com/install  
    2022-08-12T17:33:42.715Z    Error:   
    Something went wrong installing the "sharp" module  
    Cannot find module '../build/Release/sharp-linux-x64.node'  
    Require stack:  
    - /var/user/node_modules/sharp/lib/sharp.js  
    - /var/user/node_modules/sharp/lib/constructor.js  
    - /var/user/node_modules/sharp/lib/index.js  
    - /var/user/service/client/face/kh/face.js  
    - /var/user/config.js  
    - /var/user/__index.js  
    - /var/user/index.js  
    - /var/runtime/node12/UserFunction.js  
    - /var/runtime/node12/Runtime.engine.js  
    - /var/runtime/node12/bootstrap.js  
    Possible solutions:  
    - Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"  
    - Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"  
    - Consult the installation documentation: https://sharp.pixelplumbing.com/install  
        at Object.<anonymous> (/var/user/node_modules/sharp/lib/sharp.js:34:9)  
        at Module._compile (internal/modules/cjs/loader.js:1158:30)  
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)  
        at Module.load (internal/modules/cjs/loader.js:1002:32)  
        at Function.Module._load (internal/modules/cjs/loader.js:901:14)  
        at Module.require (internal/modules/cjs/loader.js:1044:19)  
        at require (internal/modules/cjs/helpers.js:77:18)  
        at Object.<anonymous> (/var/user/node_modules/sharp/lib/constructor.js:8:1)  
        at Module._compile (internal/modules/cjs/loader.js:1158:30)  
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
2022-08-13 01:41 负责人:无 分享
已邀请:
梦想与想象

梦想与想象 (作者) - 梦想不等于是幻想

sharp官方文档要求node12.13以上,我检查过云空间的node版本已经是12的了,依旧是报错,感觉是空间的依赖安装不成功

7***@qq.com

7***@qq.com

没人回复吗

要回复问题请先登录注册