Comments (10)
To be more explicit with the error message, it is:
Uncaught error: A dynamic link library (DLL) initialization routine failed module.js :640
from cap.
Sorry, didn't mean to close this!!
from cap.
Sorry, I don't really have any experience with compiling addons for use with nw.js.
from cap.
Thanks for the quick reply - I will see if I can initialize cap under Windows just from node.js. I didn't think that nw.js would be the problem. I used nw.js with cap on the Mac and it worked fine.
from cap.
IIRC nw.js has its own special method of compiling addons (using nw-gyp
) in order to properly integrate with its bundled chrome/chromium (V8 really).
Using cap
directly with node on Windows should definitely work fine though.
from cap.
This all makes sense. I will try node and cap tomorrow. Thanks for the help!
from cap.
Using cap directly with node on Windows does indeed take me beyond the 'require' statement where my error occurred. I do need the nw capabilities, and have posted the following on the nw.js site:
I have been successfully using the module cap in an osx node/nw program to receive and transmit Ethernet packets. I am porting the program to Windows, and have an issue with the cap module.
I am using node.js v6.11.0 and nw.js v0.23.5. Windows 8.1.
A problem arises at the statement:
var Cap = require('cap').Cap;
Where I get the following output:
module.js:640 Uncaught Error: A dynamic link library (DLL) initialization routine failed.
\?\D:\AVBFlexSDK\node_modules\cap\build\Release\cap.node
at Object.Module._extensions..node (module.js:640:18)
at Module.load (module.js:527:32)
at tryModuleLoad (module.js:490:12)
at Function.Module._load (module.js:482:3)
at Module.require (module.js:537:17)
at require (internal/module.js:11:18)
at Object. (D:\AVBFlexSDK\node_modules\cap\lib\Cap.js:3:13)
at Module._compile (module.js:593:30)
at Object.Module._extensions..js (module.js:610:10)
at Module.load (module.js:527:32)
The statement is not a problem within a node.js program, and the cap module installs fine (Python 2.7 and Visual C++ installed). I have done the following to resolve the issue:
- Given that I am using an LTS release, I first replaced the win_delay_load_hook.cc file with the one given on the nw.js documentation page. The require statement resulted in the same error message.
- I then followed the procedure for the non-LTS releases:
set PYTHON=C:\Python27\python.exe
set npm_config_target=0.23.5
set npm_config_arch=x64
set npm_config_runtime=node-webkit
set npm_config_build_from_source=true
set npm_config_node_gyp=C:\Users<my info>\AppData\Roaming\npm\node_modules
Still the same result - an error at the require statement.
Possibly someone in this group has had a similar experience and resolved it - which would be wonderful!
from cap.
@RichardFoss Its just about "prebuild" the target package "cap" (https://www.npmjs.com/package/prebuild).
I use Electron, so "prebuild" provide a way to compile the package to the target OS/arch. You need to find some similar tool on NW.JS.
So, that issue has nothing to do with "cap", but the way packages are compiled to the target OS.
from cap.
Thanks robsontenorio! I managed to resolve my issue and have meant to post my solution to the group in case anyone else has a similar dilemma. The steps I took are given below. Step d is the "similar tool" that you are referring to.
For native node modules (for example cap), you will:
a. First need to install all the required tools and configurations. To do this, you could use Microsoft's windows-build-tools using:
npm install --global --production windows-build-tools
from an elevated PowerShell or CMD.exe (run as Administrator). This will install Visual Studio and also Python 2.7.
b. On Windows, you need to replace the file
\node_modules\node-gyp\src\win_delay_load_hook.cc
with the one at
https://github.com/nwjs/nw.js/blob/nw18/tools/win_delay_load_hook.cc
before installing modules with node-gyp or npm.
c. Run the following command in your terminal to install nw-gyp globally:
npm install -g nw-gyp
d. If for example, cap is the native module, then in the node_modules/cap folder, run
nw-gyp rebuild --target=0.23.5(or whatever your version of nw.js is)
e. In your native module documentation, look for any programming guidelines that are unique to Windows. For example in cap:
setMinBytes(< integer >nBytes) - (void) - (Windows ONLY) This sets the minimum number of packet bytes that must be captured before the full packet data is made available.
from cap.
Thanks for the information @robsontenorio and @RichardFoss
from cap.
Related Issues (20)
- 0 bytes packets capture only HOT 11
- Issue installing cap on Windows 10 HOT 6
- TypeError: Cannot read property 'prototype' of undefined HOT 3
- 'cap.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 83. This version of Node.js requires NODE_MODULE_VERSION 89. HOT 1
- Create a packet
- This module was compiled agianst a different Node.js issue.
- `Cap.deviceList()` Permissions error HOT 2
- "Segmentation fault (core dumped)" while using cap to send many packet (number of packets < 60) HOT 1
- how to check if npcap is installed on the machine HOT 1
- Return read packets immediately on Windows 10 HOT 2
- "The specified module could not be found" HOT 5
- Does not compile under the newest node-gyp / electron-gyp HOT 2
- NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 73. Please try re-compiling or re-installing HOT 13
- .
- Does not find Pcap Library HOT 1
- Loop starvation HOT 2
- Resend packet captured from Wireshark HOT 5
- Can I send a WebSocket package without worrying about ACK number or Seq number? HOT 1
- Capture TCP segment of Reassembled PDU?
- How do I regenerate the seq number to replay captured traffic?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cap.