32

I installed gulp on my machine, but when i try to compile my project i have this error:

Error: Cannot find module 'del'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Applications/MAMP/htdocs/project/gulpfile.js:6:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

I dont understand the error and i dont know how solve. Someone can help me? Thanks

IainDunning
  • 11,546
  • 28
  • 43
user3519727
  • 361
  • 2
  • 4
  • 10

1 Answers1

61

This error message indicates that the module 'del' cannot be found. It seems that the 'del' package is not installed or not properly configured in your project.

Try installing the 'del' package by running the following command in your terminal:

npm install del --save-dev

If you have already installed 'del' package and still getting this error, try uninstalling and then reinstalling it.

npm uninstall del
npm install del --save-dev

Also make sure that you have the latest version of npm and node installed on your machine.

npm install -g npm

After installing or reinstalling 'del' package, you can try running the gulp command again and see if the error persists.

JCR000
  • 966
  • 9
  • 11
  • Warning `npm install` NOT recommended! (At least for some users.) – Joshua Drake Mar 03 '17 at 20:02
  • If you have a better solution I will edit the answer if possible. – JCR000 May 16 '17 at 17:56
  • npm install did ... 'something', but it keeps complaining about missing packages when I do a gulp watch. npm install for every new missing package does the trick. Is this because there are requires missing in my gulpfile.js? – user281681 Apr 20 '22 at 09:48
  • npm install worked for me. npm install is typically someone who sets up a sandbox has to do. So, if npm install doesn't work, make sure your package.json is correct. – thebiggestlebowski Dec 19 '22 at 18:30