收藏
回答

云函数package.json中增加一个images依赖,无法正常调用

框架类型 问题类型 终端类型 AppID 基础库版本
小程序 Bug 工具 wx4af884de75d358dd 2.4.0

- 当前 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 个回答

  • 2018-11-08

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


    {

    "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"

    }

    }

    就好了

    2018-11-08
    有用
    回复 1
    • 异次元
      异次元
      2019-10-08
      哥们,你就留在这个版本了么?我3.0.2的也不行,我去试试你的
      2019-10-08
      回复
登录 后发表内容