云函数package.json中增加一个images依赖,无法正常调用
发布于 6 年前 作者 juandu 7332 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)
  • 返回结果:

    Missing binding /var/user/node_modules/images/vendor/linux-x64-57/binding.node

    imagescould 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 8.x

      - Linux 64-bit with Node.js 8.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.

  • 日志:

    END RequestId: d336b8a1-e327-11e8-a06f-525400e8849e

    Report RequestId: d336b8a1-e327-11e8-a06f-525400e8849e Duration:9.773ms Memory:256MB MaxMemoryUsed:0.746094MB

  • 预期表现

可以正常调用新安装的images库依赖中的方法

1 回复

换了一个依赖的版本居然就好了,太奇怪了。

{

“name”: “imageProcess”,

“version”: “1.0.0”,

“description”: “”,

“main”: “index.js”,

“scripts”: {

“test”: “echo \“Error: no test specified\” && exit 1”

},

“author”: “”,

“license”: “ISC”,

“dependencies”: {

“wx-server-sdk”: “latest”,

“images”: “latest”

}

}

改成

{

“name”: “imageProcess”,

“version”: “1.0.0”,

“description”: “”,

“main”: “index.js”,

“scripts”: {

“test”: “echo \“Error: no test specified\” && exit 1”

},

“author”: “”,

“license”: “ISC”,

“dependencies”: {

“wx-server-sdk”: “latest”,

“images”: “2.2.1”

}

}

就好了

回到顶部