我有一个需求,我必须访问一个C函数并将它公开为一个API。我应该在Node.js服务器上部署它。我不知道如何使用任何节点包访问C函数。我尝试过使用node-ffi包,但是在安装时它给了我错误:
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位)。
发布于 2015-04-14 17:11:45
尝试使用此包安装node-ffi:https://www.npmjs.com/package/ffi。注意,它被称为ffi,而不是Notice。
还请确保您拥有Python的2.7.3版本。's GitHub page提到2.7.3是Windows操作系统的推荐版本。
https://stackoverflow.com/questions/29530911
复制相似问题