This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan
<p>I have been running a small service on Google Compute Engine (Ubuntu) that requires
the <code>google-cloud</code> npm module but I kept hitting an error with <code>grpc_node.node</code>
not being found.</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">Error: Cannot find module <span style="color:#e6db74">'/home/paul_kinlan/web-push-rocks/frontend/node_modules/google-cloud/node_modules/grpc/src/node/extens
</span><span style="color:#e6db74">ion_binary/grpc_node.node'</span>
at Function.Module._resolveFilename <span style="color:#f92672">(</span>module.js:469:15<span style="color:#f92672">)</span>
at Function.Module._load <span style="color:#f92672">(</span>module.js:417:25<span style="color:#f92672">)</span>
at Function._load <span style="color:#f92672">(</span>/usr/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21<span style="color:#f92672">)</span>
at Module.require <span style="color:#f92672">(</span>module.js:497:17<span style="color:#f92672">)</span>
at require <span style="color:#f92672">(</span>internal/module.js:20:19<span style="color:#f92672">)</span>
at Object.<anonymous> <span style="color:#f92672">(</span>/home/paul_kinlan/web-push-rocks/frontend/node_modules/google-cloud/node_modules/grpc/src/node/src/gr
pc_extension.js:38:15<span style="color:#f92672">)</span>
at Module._compile <span style="color:#f92672">(</span>module.js:570:32<span style="color:#f92672">)</span>
at Object.Module._extensions..js <span style="color:#f92672">(</span>module.js:579:10<span style="color:#f92672">)</span>
at Module.load <span style="color:#f92672">(</span>module.js:487:32<span style="color:#f92672">)</span>
at tryModuleLoad <span style="color:#f92672">(</span>module.js:446:12<span style="color:#f92672">)</span>
</code></pre></div><p>It was incredibly frustrating as I have not seen any recognition of the issues
that many people are facing.</p>
<p>The solution that I found (well <a href="https://dassur.ma/">Surma</a> on our team found)
was to force a rebuild of the module from source as follows:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">npm install
npm rebuild --build-from-source google-cloud
</code></pre></div><p>Stupid node. Stupid Cloud platform. :)</p>
This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan