云函数第三方npm使用的环境问题,咋办?
发布于 6 年前 作者 kongfang 689 次浏览 来自 官方Issues

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

那么问题来了。。。我在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 回复

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

回到顶部