1

I have a requirement where I have to access a C function and expose it as an API. I am supposed to deploy it on Node.js server. I don't know how to access C function using any node package. I have tried using node-ffi package but at the time of installation it gives me error:

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! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.

Note that I am using Python 2.7 and Windows 7 (32-bit).

1 Answer 1

1

Try to use this package to install node-ffi: https://www.npmjs.com/package/ffi. Notice that it's called ffi, not node-ffi.

Also make sure that you have the version 2.7.3 of Python. node-gyp's GitHub page mentions that 2.7.3 is the recommended version for Windows operating system.

Sign up to request clarification or add additional context in comments.

2 Comments

Did you try to use the suggested package? It works well in my case.
Thanks, I am able to install ffi module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.