Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS Debugging Error: No such module: http_parser

I was debugging my nodejs app in vs-code without errors, but suddenly it did begin to give this error:

Error: No such module: http_parser
at internalBinding (internal/bootstrap/loaders.js:104:17)
at _http_client.js:27:24
at NativeModule.compile (internal/bootstrap/loaders.js:363:7)
at NativeModule.require (internal/bootstrap/loaders.js:174:18)
at http.js:25:27
at NativeModule.compile (internal/bootstrap/loaders.js:363:7)
at Function.NativeModule.require (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)

Actually the app works successfully, for example, express-js http functions work as expected, but i am unable to do debugging.

  • I have already installed that package, named as http-parser

Edit: Node Version: v10.14.2, there is no extensions installed, just the vs-code built-in debugging runtime. After i have inspected more, the execution was coming to the loader.js and was terminating afterwards.

Edit2: Renaming the project folder fixed the issue but why? Could anybody explain this?

like image 505
Ahmet Gokdayi Avatar asked Jan 22 '19 08:01

Ahmet Gokdayi


People also ask

What is Enoent error in Nodejs?

The code ENOENT means that npm fails to open a file or directory that's required for executing the command. The npm start command is used to run the start script in the package. json file.25-Jun-2022.

What is error captureStackTrace?

Error.captureStackTrace() A non-standard V8 function that creates the stack property on an Error instance.

What is runtime error in node JS?

Runtime errors occur whenever something unexpected occurs in your application, and they often lead to catastrophic issues that can crash your program. Like many languages, Node. js provides a mechanism to anticipate errors before they occur.


1 Answers

What version of node.js and vs code are you debugging?

Some Solutions:

1.Try to rename the project folder

2.Disable extensions and see which extension is influencing the debugging

3.You could also disable the check boxes

All Exceptions and Uncaught Exceptions under Debug > Breakpoints, can debug your application check if it works

like image 67
Shubham Tiwari Avatar answered Jan 28 '23 07:01

Shubham Tiwari