title: debugging npm ERR! code ELIFECYCLE npm ERR! errno 1
body: <p>Asking for an advise on how to debug this compiler error:</p>
  
  <pre><code>npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! ******@1.1.0 dev: `NODE_ENV=development ts-node ./src/server.ts`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the ******@1.1.0 dev script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  
  npm ERR! A complete log of this run can be found in:
  </code></pre>
  
  <p>this appears when running <code>ts-node ./src/server.ts</code> or <code>node build/server.js</code></p>
  
  <p><code>tsc</code> works without errors.</p>
  
  <p><code>tsconfig.json</code>:</p>
  
  <pre><code>{
     "compilerOptions": {
        "lib": [
           "es2018",
           "dom",
           "esnext.asynciterable"
        ],
        "target": "es2018",
        "module": "commonjs",
        "outDir": "build",
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "esModuleInterop": true,
        "sourceMap": false,
        "rootDirs": ["src", "../shared"]
  //      "rootDir": "src"
     },
     "exclude": [
        "node_modules",
        "**/*.spec.ts",
        "**/*.test.ts"
     ],
     "references": [
        { "path": "../shared" }
     ]
  }
  </code></pre>
  
  <p>I did made some changes in tsconfig which i suppose cause some imports to fail, however the codebase is huge and i really need some pointers to the exact lines in code which caused the error. especially confusing the <code>tsc</code> runs without errors.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The issue was with some imports and fixed, However facing similar one again. Know the reason of the current issue - for some reason the imports from shared project (as in here <a href="https://www.typescriptlang.org/docs/handbook/project-references.html" rel="noreferrer">https://www.typescriptlang.org/docs/handbook/project-references.html</a>) are not loaded (despite that they are working in other modules and tsconfig.json is the same with other modules). no particular error, just this <code>npm ERR! code ELIFECYCLE npm ERR! errno 1</code>.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>However the main question of this topic is not the solution of the particularly this problem, but how to debug this kind of import problems where all available log is basically <code>npm ERR! code ELIFECYCLE npm ERR! errno 1</code>. I am facing this kind of issues periodically and every time it takes a lot of time to resolve since the only way to debug i know about is to comment chunks of code which might be associated with the possibly failed imports and sometimes this process could take hours.</p>