Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hi, I get this bug here Error: Cannot find module 'debug'

Maybe I deleted something on package.json but I wrote again (I not uninstalled) I get this bug:

Error: Cannot find module 'debug'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\Leo\fase2\node_modules\nodemon\lib\nodemon.js:1:75)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
error Command failed with exit code 1.

I am lost!! what is causing the problem?

like image 792
Leo Igel Avatar asked May 02 '19 08:05

Leo Igel


2 Answers

You seem to have debug module missing in your node_modules. npm install debug --save will solve the issue,also it will create an entry in package.json for the package. For further info have a look at official docs

like image 115
Shubh Avatar answered Oct 16 '22 19:10

Shubh


It could be an issue with your local node_modules directory. I would recommend deleting and re-installing it fresh. Then check your local dependencies to see if debug is included again.

Before you attempt the below, make sure you are in your project folder!

To do so, delete the folder node_modules and use npm install debug to re-install. If this fails you can check the created log for any specific errors that occurred during installation.

like image 1
RobSteward Avatar answered Oct 16 '22 20:10

RobSteward