title: Nodejs/npm: How to reinstall/recompile copied app packages
body: <p><strong>Setup:</strong></p>
  
  <ul>
  <li><p>A VM with an Internet connection where <code>npm install</code> will be executed to install all the app dependencies. The result will be a folder with the app and its dependencies in <code>node_modules</code>.</p></li>
  <li><p>Between the app modules is fi: <code>mongoose</code>, which on installation time uses <code>node-gyp</code> to compile a native BSON extension.</p></li>
  <li><p>The app folder is copied to another VM without an Internet conection and it is fully functional, but then the compiled extensions don't work but its <code>.js</code> fallbacks does.</p></li>
  </ul>
  
  <p><strong>Question:</strong></p>
  
  <p>How can I reinstall/recompile/regenerate all the app modules on the new VM without an Internet conection?</p>