Comments (4)
My hypothesis is that there's something in your environment that makes node-gyp (the build tool) think it's building for a UNIX system. It's supposed to build win_dummy.cc instead of unix_dgram.cc; there's a OS=="win"
guard in binding.gyp to that effect.
What might work is node-gyp rebuild -- -DOS=win
, although I don't know how you'd pass that through npm.
from node-unix-dgram.
I get the exact same error. I tried installing winston-syslog on windows 10 and get:
$ npm i winston-syslog
> [email protected] install C:\Users\Me\Projects\Project\node_modules\unix-dgram
> node-gyp rebuild
C:\Users\Me\Projects\Project\node_modules\unix-dgram>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
unix_dgram.cc
win_delay_load_hook.cc
C:\Users\Me\Projects\Project\node_modules\unix-dgram\src\unix_dgram.cc(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\Users\Me\Projects\Project\node_modules\unix-dgram\build\unix_dgram.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Me\Projects\Project\node_modules\unix-dgram
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
...
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\unix-dgram):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
After the install, since it skipped unix-dgram "optional dependency", I tried running the file with require('winston-syslog')
and i got:
ERROR in ./node_modules/winston-syslog/lib/winston-syslog.js
Module not found: Error: Can't resolve 'unix-dgram' in 'C:\Users\Me\projects\project\node_modules\winston-syslog\lib'
I tried on my coworkers laptop, and he received the same error.
Please let me know if you need any more info, I will gladly provide and test things out :)
from node-unix-dgram.
@Kresten In your case it's because you're installing v2.0.3 but it's only 2.0.4 that has the win32 stub code.
winston-syslog loads unix-dgram lazily but keep in mind that unix-dgram doesn't actually work on Windows (it's a stub, after all) so it's not like it's a useful combination. Plain UDP-over-IP should work though.
from node-unix-dgram.
Thank you for the quick reply!
I installed the newest unix-dgram and got
$ npm i unix-dgram
> [email protected] install C:\Users\Me\Projects\Project\node_modules\winston-syslog\node_modules\unix-dgram
> node-gyp rebuild
C:\Users\Me\Projects\Project\node_modules\winston-syslog\node_modules\unix-dgram>
if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )
else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
unix_dgram.cc
win_delay_load_hook.cc
C:\Users\Me\Projects\Project\node_modules\winston-syslog\node_modules\unix-dgram\src\unix_dgram.cc(9):
fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\Users\Me\Projects\Project\node_modules\winston-syslog\node_modules\unix-dgram\build\unix_dgram.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Me\Projects\Project\node_modules\winston-syslog\node_modules\unix-dgram
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
> [email protected] install C:\Users\Me\Projects\Project\node_modules\unix-dgram
> node-gyp rebuild
C:\Users\Me\Projects\Project\node_modules\unix-dgram>
if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )
else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
win_dummy.cc
win_delay_load_hook.cc
Creating library C:\Users\Me\Projects\Project\node_modules\unix-dgram\build\Release\unix_dgram.lib and object C:\Users\Me\Projects\Project\node_modules\unix-dgram\build\Releas e\unix_dgram.exp
Generating code
All 3 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code
unix_dgram.vcxproj -> C:\Users\Me\Projects\Project\node_modules\unix-dgram\build\Release\\unix_dgram.node
I hope the first fail is intended to swap over to the dummy build :) The file runs fine now.
I'm only using the Syslog connection in production to connect to papertrail, since winston does not have an up-to-date papertrail transport.
Thanks again!
from node-unix-dgram.
Related Issues (20)
- Failing to compile on Travis with Node 4.2.1 HOT 2
- does not work on node 4 or node 5 HOT 2
- getting a "make" error when building on CentOS 7 HOT 2
- Can't install in node 6 HOT 1
- Buffer limited to 2048 on Mac OS HOT 6
- Sending data in loop fails HOT 6
- - sorry -
- callback not used in case of congestion HOT 1
- Improve mismatched type handling. HOT 1
- Error | Failing build unix-dgram on solaris HOT 4
- Install failed using Node v10 HOT 2
- nodejs 12 support HOT 1
- Nan::NAN_METHOD_RETURN_TYPE HOT 1
- 2.0.3 causes hangs on Node < 12 HOT 2
- No buffer space available, write errror HOT 5
- unix-dgram does not seem to work with Node v13? HOT 3
- Failing to build (ubuntu 20.04) HOT 1
- Is it possible to add Windows support? HOT 1
- Doesn't build on Node 20.9.0 HOT 1
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 node-unix-dgram.