javascriptexpress

Debug errors in expressJs


I'm trying to use the debugger of Visual Studio Code but it crashes at startup, when i run the server using nodemon it works perfectly fine

I'm using MySql Database. I've tried to install the module again but i can't.

The error takes place in loaders.js at this line: mod = getInternalBinding(module)

let internalBinding;
  {
    const bindingObj = ObjectCreate(null);
    internalBinding = function internalBinding(module) {
      let mod = bindingObj[module];
      if (typeof mod !== 'object') {
        try {
          mod = getInternalBinding(module);
        } catch {
          // v10.x only: Fall back to `process.binding()`,
          // to avoid future merge conflicts when backporting changes that use
          // `internalBinding()` to v10.x.
          mod = process.binding(module);
        }
        bindingObj[module] = mod;
        moduleLoadList.push(`Internal Binding ${module}`);
      }
      return mod;
    };
  }

Exception has occurred: Error
Error: No such module: http_parser.   
    at internalBinding (internal/bootstrap/loaders.js:104:1`enter code here`7).   
    at _http_client.js:27:24.   
    at NativeModule.compile (internal/bootstrap/loaders.js:362:7).   
    at NativeModule.require (internal/bootstrap/loaders.js:174:18).   
    at http.js:25:27.   
    at NativeModule.compile (internal/bootstrap/loaders.js:362:7).   (internal/bootstrap/loaders.js:174:18)    
    at Function.Module._load (internal/modules/cjs/loader.js:517:25).  
    at Module.require (internal/modules/cjs/loader.js:637:17)   
    at require (internal/modules/cjs/helpers.js:22:18)

Solution

  • In Visual Studio Code, go to Debug view, at the bottom there is a breakpoints section, just uncheck 'All Exceptions' and uncheck 'Uncaught Exceptions'.