收藏
回答

云函数第三方npm使用的环境问题,咋办?

大家都知道,云函数可以“上传并且在服务器安装依赖”,也可以“上传编译好的本地依赖”

那么问题来了。。。我在mac上编译,上传云函数包括编译好的,就会报错说,当前系统环境不支持,

Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 3d78f7f2-e9c5-11e9-ae27-52540025df0e, cloud function service error code -504002, error message Missing binding /var/user/node_modules/images/vendor/linux-x64-57/binding.node
images could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
 
Found bindings for the following environments:
  - OS X 64-bit with Node.js 10.x
 
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild images --force` to build the binding for your current environment.; at cloud.callFunction api;


如果我“上传并且在服务器安装依赖(不上传npm包)”,就会爆下面的错

Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 181b67d9-e9c6-11e9-af3a-525400192d0e, cloud function service error code -504002, error message Missing binding /var/user/node_modules/images/vendor/linux-x64-57/binding.node
images could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
 
Found bindings for the following environments:
  - Linux 64-bit with Unsupported runtime (72)
 
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild images --force` to build the binding for your current environment.; at cloud.callFunction api;


哎。很多图片处理的npm库都需要native的一些东西的呀。。。云函数的server貌似没有呀

回答关注问题邀请回答
收藏

1 个回答

  • 吃包子不吐包子皮
    吃包子不吐包子皮
    2019-10-08

    在linux,centos环境下装包试试,云函数运行环境是linux的环境

    2019-10-08
    有用
    回复 1
    • 异次元
      异次元
      2019-10-08
      这就麻烦了。。。
      2019-10-08
      回复
登录 后发表内容
问题标签