首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Node.js访问C函数

从Node.js访问C函数
EN

Stack Overflow用户
提问于 2015-04-09 06:02:49
回答 1查看 764关注 0票数 1

我有一个需求,我必须访问一个C函数并将它公开为一个API。我应该在Node.js服务器上部署它。我不知道如何使用任何节点包访问C函数。我尝试过使用node-ffi包,但是在安装时它给了我错误:

代码语言:javascript
复制
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: incorrect header check
gyp ERR! stack     at Zlib._binding.onerror (zlib.js:295:17)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\niket_kumar\AppData\Roaming\npm\node_modules\node-ffi
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok

npm ERR! node-ffi@0.5.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-ffi@0.5.7 install script.

注意,我使用的是Python2.7和Windows 7(32位)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-04-14 17:11:45

尝试使用此包安装node-ffihttps://www.npmjs.com/package/ffi。注意,它被称为ffi,而不是Notice。

还请确保您拥有Python的2.7.3版本。's GitHub page提到2.7.3是Windows操作系统的推荐版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29530911

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档