使用FFI的问题 [英] Problem using FFI

查看:227
本文介绍了使用FFI的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的Azure团队

我已经在nodejs函数中安装了ffi,但是出现以下错误,您能指出我发生了什么吗?

I have installed ffi in a nodejs function, however I am getting the following error, could you please point me to what is going on?

我用过:npm install ffi
并且还尝试使用不同版本的ffi,但没有运气

I used: npm install ffi
And also tried to use different versions of ffi but with no luck

2018-10-23T09:49:48 欢迎使用,您现在已连接到日志流服务.
2018-10-23T09:50:48 过去1分钟内没有新的跟踪记录.
2018-10-23T09:51:04.648 [信息]执行'Functions.HttpTrigger1'(原因='此函数通过主机API以编程方式调用.',ID = f68f6b76-9d4c-4346-9c20-fa2b2fe2c5f3)
2018-10-23T09:51:04.664 [信息] JavaScript HTTP触发函数处理了一个请求.
2018-10-23T09:51:04.831 [错误]执行了'Functions.HttpTrigger1'(失败,ID = f68f6b76-9d4c-4346-9c20-fa2b2fe2c5f3)
结果:失败
异常:错误:模块'/home/node_modules/ref/build/Release/binding.node'
使用
针对不同的Node.js版本进行了编译 NODE_MODULE_VERSION 48.此版本的Node.js要求
NODE_MODULE_VERSION 57.请尝试重新编译或重新安装
模块(例如,使用`npm rebuild`或`npm install`).
堆栈:错误:模块'/home/node_modules/ref/build/Release/binding.node'
使用
针对不同的Node.js版本进行了编译 NODE_MODULE_VERSION 48.此版本的Node.js要求
NODE_MODULE_VERSION 57.请尝试重新编译或重新安装
模块(例如,使用`npm rebuild`或`npm install`).
   在Object.Module._extensions..node(module.js:682:18)
   在Module.load(module.js:566:32)
   在tryModuleLoad(module.js:506:12)
   在Function.Module._load(module.js:498:3)
   在Module.require(module.js:597:17)
   在要求时(internal/module.js:11:18)
   在绑定(/home/node_modules/bindings/bindings.js:76:44)
    < anonymous>. (/home/node_modules/ref/lib/ref.js:5:47)
   在Module._compile(module.js:653:30)
   在Object.Module._extensions..js(module.js:664:10)

2018-10-23T09:49:48  Welcome, you are now connected to log-streaming service.
2018-10-23T09:50:48  No new trace in the past 1 min(s).
2018-10-23T09:51:04.648 [Information] Executing 'Functions.HttpTrigger1' (Reason='This function was programmatically called via the host APIs.', Id=f68f6b76-9d4c-4346-9c20-fa2b2fe2c5f3)
2018-10-23T09:51:04.664 [Information] JavaScript HTTP trigger function processed a request.
2018-10-23T09:51:04.831 [Error] Executed 'Functions.HttpTrigger1' (Failed, Id=f68f6b76-9d4c-4346-9c20-fa2b2fe2c5f3)
Result: Failure
Exception: Error: The module '/home/node_modules/ref/build/Release/binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
Stack: Error: The module '/home/node_modules/ref/build/Release/binding.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:682:18)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at bindings (/home/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/home/node_modules/ref/lib/ref.js:5:47)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)

Renato2099

Renato2099

推荐答案

您好Renato,

Hi Renato,

我相信您会看到此信息,因为ffi太过时且未针对较新版本的node进行维护(请参见 ffi安装问题.对于V1 Azure函数,我们要求您使用节点v6的锁定版本.对于V2 Azure Functions(默认),我们要求您使用任何节点v8或v10版本.

I believe you're seeing this because ffi is very outdated and not maintained against newer versions of node (see comment here and other issues with ffi installation on their repo). For V1 Azure Functions, we require you to use a locked version of node v6. For V2 Azure Functions (the default), we require you to use any node v8 or v10 version. 

尽管这是一个ffi问题,但我的第一个建议是建议您找到要维护的模块.我的第二个建议是实际尝试"npm rebuild".从控制台上运行"npm install ffi".然后,尝试运行"npm 安装ffi"再次.

Although this is an ffi issue, my first suggestion is for you to find a module that is being maintained. My second suggestion is to actually try "npm rebuild" from the console, where you ran "npm install ffi". Then, try running "npm install ffi" again.

谢谢

玛丽


这篇关于使用FFI的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆