Node.js - Cannot read property 'toString' of null when running package on Windows
<p>I am using the <code>gulp</code> and <code>hercule</code> package on node.js to transclude some plain text files. On Unix, everything seems to work fine. However, some coworkers are having issues running it on Windows. They are getting the following error message only when running on Windows:</p>

<pre><code>[13:02:01] TypeError: Cannot read property 'toString' of null at Object.transcludeStringSync (D:\project\node_modules\hercule\lib\hercule.js:136:36)
</code></pre>

<p>I have tried the above with <code>hercule@3.0.5</code> as well as <code>hercule@2.0.5</code>, and both packages give the above error. However, given that this occurs only on Windows and across many versions of the package, I suspect this issue <em>has something to due with the Node.js installation or path</em>.</p>

<p>The code that is using the <code>hercule</code> package:</p>

<pre><code>var fs = require('fs');
var path = require('path');
var gulp = require('gulp');
var drakov = require('drakov');
var hercule = require('hercule');

gulp.task('mock', ['i18n','build_minify_no_tests'], function() {
    var mockSpecificationTemplate= fs.readFileSync('test/mock/mock-template.apib','utf8');
    var transcludedMockSpecification = hercule.transcludeStringSync(mockSpecificationTemplate, {
        relativePath: path.resolve('../../../')
    });
    fs.writeFileSync('test/mock/mock.apib', transcludedMockSpecification, 'utf-8');

    // Running mock server
    var drakovArgv = {
        sourceFiles: 'test/mock/mock.apib',
        serverPort: 9000,
        staticPaths: [
            '../../'
        ],
        discover: true,
        watch: true
    };
    drakov.run(drakovArgv);
});
</code></pre>

<p><code>node</code> and <code>npm</code> version information:</p>

<pre><code>$ node -v
v6.3.0
$ npm -v
3.10.3
</code></pre>