Hi,
I originally posted this issue on stackoverflow
here
After following up through comments over there I was able to discover that my %errorlevel% is set to a negative value. The only reference to this I have found in reference to node was because of node segfaulting so I decided to post here to perhaps get more traction.
I was doing some work with Gulp and pushed my tasks to our Windows 2008 R2 server where they strangely stopped working.
The tasks are just exiting at a certain point and return me to prompt. Everything is working fine on my Windows 7 dev machine and on one Windows 2008 R2 server, so far the issue is only occuring on our development Windows 2008 R2 server
Through isolation, I was able to narrow it down to the module
Pretty bytes which uses Math.log in its calculation. I tried to use Math.log directly from node and I get the same result on that one server. It looks like Math.log is broken, however other Math functions work just fine.
Reproduction steps below:
Details:
2 different Windows 2008 R2 running in a VM (if that's important)
node v0.12.7
//nodemathtest.js
console.log(process.versions);
console.log("before");
console.log(Math.floor(2.2));
console.log(Math.log(10));
console.log("after");
Running
On one my machine and on one Windows 2008 R2 server I get the expected result:
C:\>node mathlogtest.js
{ http_parser: '2.3',
node: '0.12.7',
v8: '3.28.71.19',
uv: '1.6.1',
zlib: '1.2.8',
modules: '14',
openssl: '1.0.1p' }
before
2
2.302585092994046
after
On our development Windows server where the Gulp tasks are exiting prematurely I get this:
C:\>node mathlogtest.js
{ http_parser: '2.3',
node: '0.12.7',
v8: '3.28.71.19',
uv: '1.6.1',
zlib: '1.2.8',
modules: '14',
openssl: '1.0.1p' }
before
2
C:\>
I can see that Math.log is causing Node to exit immediately back to prompt which is also what's happening from Gulp, I get kicked back to my prompt and the task is interrupted.
After this running
echo %ERRORLEVEL% returns -1073741795 on the faulty server, 0 where it's successful.I'm not exactly sure where to look as I'm fairly new to Node. From my understanding Node is using Chrome's V8 JS engine and `process.version` is returning exactly the same on each server. I've tried to install .NET 4.5.1 and various C++ redistributable package to no avail.