mscdex / cap

A cross-platform binding for performing packet capturing with node.js
MIT License
361 stars 45 forks source link

Question: Installing on Windows #34

Closed alexandrubau closed 9 years ago

alexandrubau commented 9 years ago

Hi,

I'm not able to install cap on Windows. I receive the following error:

one two three

I have installed:

To install cap I used npm install cap --save

I installed without any problems cap on my OS X machine. Is there a problem if I copy it from my OS X machine into my Windows machine ? Or do I need to run npm install cap on my Windows machine ?

What am I doing wrong ?

Thanks

mscdex commented 9 years ago

Yes, you have to install it separately on Windows because it's a compiled thing.

Secondly, are you sure you selected Visual C++ when you installed Visual Studio? It's possible you installed other components instead (e.g. C#). If you did install Visual C++, then you might try installing from one of the special Visual Studio command prompts that explicitly sets up the environment for you.

If you're still having problems after that, your issue is better placed at the node-gyp issue tracker as this is not a problem with cap itself.

alexandrubau commented 9 years ago

I think it's related to https://github.com/nodejs/node-gyp/issues/694 . I'll try there. Maybe I'll make some time to modify the readme to help others and I'll hit you with a pull request.

Thanks very much for your help.

alexandrubau commented 9 years ago

But the cap module requires Python in order to run on Windows ?

mscdex commented 9 years ago

All node addons require Python and a compiler, that means VS on Windows or clang/gcc on *nix. These are requirements set by node-gyp.

The only extra requirement set by this addon is that you have WinPCap installed if you're on Windows, or libpcap/libpcap-dev installed on *nix.

alexandrubau commented 9 years ago

What I wanted to ask was that Python is required only to compile the module ? Will it be required further if I say, move the module to another Windows machine ?

mscdex commented 9 years ago

If you move your node_modules to another machine of the same platform and architecture (and provided the appropriate C/C++ libraries are installed), then you don't need to recompile again (so you don't need Python or a compiler).