Node.js module "fibers" not taking the correct version
<p>I'm pretty new to <code>node.js</code> and its package management system and its <code>require</code>.  I'm having trouble with the following runtime error I'm getting after having installed a bunch of packages with <code>npm install</code>:</p>

<pre><code>ERROR: Couldn't initialise framework "wdio-mocha-framework".
Error: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found 
(required by &lt;path&gt;.../node_modules/fibers/bin/linux-ia32-v8-5.0/fibers.node)
at Error (native)
</code></pre>

<p>My understanding of the error is that the binary <code>fibers.node</code> was compiled with a newer <code>libstdc++</code> than the one available at runtime.</p>

<p>It appears to me like the <code>npm install</code> did compile a <code>fibers.node</code>:</p>

<pre><code>&gt; fibers@1.0.13 install &lt;path&gt;.../node_modules/fibers
&gt; node build.js || nodejs build.js

make[1]: Entering directory `&lt;path&gt;.../node_modules/fibers/build'
&lt;snip some output, including warnings, here that I don't deem relevant&gt;
Installed in `&lt;path&gt;.../node_modules/fibers/bin/linux-ia32-v8-3.14/fibers.node`
</code></pre>

<p>However, I see that the <code>fibers.node</code> that is throwing the error at runtime is not the same one as was compiled, and I assume that's the source of the problem.</p>

<p>Compiled:</p>

<pre><code>.../linux-ia32-v8-3.14/fibers.node
</code></pre>

<p>Used at runtime and fails:</p>

<pre><code>.../linux-ia32-v8-5.0/fibers.node
</code></pre>

<p>So I'm guessing and hoping that if I could convince <code>wdio-mocha-framework</code> to use the locally-compiled <code>fibers.node</code>, it would work.  My questions are thus:</p>

<ol>
<li>Would that fix it?</li>
<li>If so, how do I achieve that?</li>
<li>If not, what's the correct direction to take to further understand and fix this error?  Perhaps instead of getting <code>3.14</code> to be used at runtime, I should be convincing <code>5.0</code> to be compiled at install-time?  Or ... other?</li>
</ol>

<p>Your help is most sincerely appreciated.</p>

<h2>Update/Edit:</h2>

<p>I think I solved this on my own, in case anyone ever finds this poor, dusty old question lying forgotten on the back of a shelf somewhere...</p>

<p>The problem was apparently due to multiple versions of <code>node</code>/<code>node-gyp</code> that were installed in my environment in parallel, and the build process, even though it was started with a newer version of <code>node</code>, was finding <code>node-gyp</code> in the <code>$PATH</code> and that's apparently what caused the old version of <code>fibers</code> to be built.  At least, I think so.</p>