mscdex / cap

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

Issue installing cap on Windows 10 #101

Closed AdrienGiboire closed 4 years ago

AdrienGiboire commented 4 years ago

I have no clue what's the issue. I hope you can understand with the output I get because I don't. I have installed npcap via the installer I downloaded, with the compatibility checked.

wacha $ node -v
v11.15.0
wacha $ npm install cap

> cap@0.2.1 install C:\Users\Plouf\code\wacha\node_modules\cap
> node-gyp rebuild

C:\Users\Plouf\code\wacha\node_modules\cap>if not defined npm_config_node_gyp (node "C:\Users\Plouf\AppData\Roaming\nvm\v11.15.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\Plouf\AppData\Roaming\nvm\v11.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Python38\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:299:12)
gyp ERR! stack     at ChildProcess.emit (events.js:193:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:999:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Plouf\\AppData\\Roaming\\nvm\\v11.15.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Plouf\code\wacha\node_modules\cap
gyp ERR! node -v v11.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN wacha@1.0.0 No description
npm WARN wacha@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cap@0.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cap@0.2.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Plouf\AppData\Roaming\npm-cache\_logs\2020-05-25T21_05_04_734Z-debug.log
mscdex commented 4 years ago

There are two things to note here:

AdrienGiboire commented 4 years ago
  • Node v11.x is no longer a supported branch

Wot? In the readme it says "node.js -- v4.0.0 or newer". I'm confused 😁

  • Node v11.x does not support Python 3.x. You will need to use Python 2.7 or upgrade to node v12.x or newer.

OK, did not know that. I don't have much experience with nodejs yet :3

Thanks, I'll try update nodejs and see how it goes.

AdrienGiboire commented 4 years ago

Just updated node and I could install it as expected. I guess a lil' update for the readme could be wise 😁

mscdex commented 4 years ago

Wot? In the readme it says "node.js -- v4.0.0 or newer". I'm confused

I should clarify that I actually meant supported by the team that works on node.js itself, which pretty much extends to any node.js addon developer. All odd-numbered node.js major version branches are not LTS and are supported for a much shorter span of time.

mscdex commented 4 years ago

Additionally it's inherently implied that (platform-specific) build requirements include those of node.js itself since node.js addons utilize the build system used by/with node.

AdrienGiboire commented 4 years ago

OK, thanks for the explanation. I am not familiar enough with this kind of information :)