title: Apex Up - Error: Cannot find module 'debug'
body: <p>The error persists after I CLI enter <code>up stack delete</code> and also when I CLI enter <code>up</code> in an alternative directory that I know worked previously. Error also persists if I revert inconsequential changes to a prior working state. </p>
  
  <p>Changing the name field in the <code>up.json</code> file results in a successful deploy in the alternate directory! But something about deploying with the same alternate name from my problem directory causes the issue again.</p>
  
  <p><code>npm i -S debug</code> does not help.</p>
  
  <p>Has anyone else experienced and resolved this problem somehow?</p>
  
  <p><strong>UPDATE:</strong> Getting closer. By commenting things in and out I've got the error </p>
  
  <blockquote>
    <p>"Error: Cannot find module './src/resolvers'"</p>
  </blockquote>
  
  <p>From line:</p>
  
  <pre><code>var resolvers_1 = require("./src/resolvers");
  </code></pre>
  
  <p>Changing to:</p>
  
  <pre><code>var resolvers_1 = require("./resolvers");
  </code></pre>
  
  <p>fixes the single import issue, but not the remaining...</p>
  
  <p>I'd move the index.js file to the src directory and keep a flat file structure... but I have complex reasons I can't do that.</p>
  
  <p><strong>"apex logs" of issue:</strong></p>
  
  <blockquote>
    <p>Aug 31st 05:58:27pm INFO staging 88776d6 initializing</p>
    
    <p>Aug 31st 05:58:27pm INFO staging 88776d6 starting app: PORT=33461 command=node dist/index.js</p>
    
    <p>Aug 31st 05:58:27pm INFO staging 88776d6 started app</p>
    
    <p>Aug 31st 05:58:27pm INFO staging 88776d6 waiting for app to listen on PORT</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6 module.js:549</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     throw err;</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     ^</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6 </p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6 Error: Cannot find module 'debug'</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Function.Module._resolveFilename (module.js:547:15)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Function.Module._load (module.js:474:25)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Module.require (module.js:596:17)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at require (internal/module.js:11:18)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Object. (/var/task/node_modules/finalhandler/index.js:14:13)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Module._compile (module.js:652:30)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Object.Module._extensions..js (module.js:663:10)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Module.load (module.js:565:32)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at tryModuleLoad (module.js:505:12)</p>
    
    <p>Aug 31st 05:58:28pm ERRO staging 88776d6     at Function.Module._load (module.js:497:3)</p>
    
    <p>Aug 31st 05:58:42pm FATA staging 88776d6 error creating handler: waiting for <a href="http://127.0.0.1:33461" rel="nofollow noreferrer">http://127.0.0.1:33461</a> to be in listening state: timed out after 15s: name=clowdfuncserver type=server</p>
    
    <p>Aug 31st 05:58:42pm INFO 2018-09-01T00:58:42.959Z  22adf73a-ad82-11e8-9c6c-79de5ffabc3f    Error: read ECONNRESET<br>
        at _errnoException (util.js:1022:11)<br>
        at Pipe.onread (net.js:628:25)</p>
  </blockquote>