Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Gulp Basics Improving your Gulp Task Pipelines The Build and Development Pipeline

Samuel Fortunato
Samuel Fortunato
20,229 Points

SOLVED: FIX YOUR TYPOS!! del error: module.js:549 Cannot find module 'def'

    throw err;

Error: Cannot find module 'def'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\***************\gulpfile.js:9:8)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

Is this an error with del? Tried to reinstall del. Didn't work. :/

Samuel Fortunato
Samuel Fortunato
20,229 Points

Tried to install a module called def (npm install def --save-dev), but then I got this error:

[16:24:08] Using gulpfile ~\**********\gulpfile.js
[16:24:08] Starting 'clean'...
[16:24:08] 'clean' errored after 109 μs
[16:24:08] TypeError: del is not a function
    at Gulp.gulp.task (C:**********\gulpfile.js:43:2)
    at module.exports (C:\**********\node_modules\orchestrator\lib\runTask.js:34:7)
    at Gulp.Orchestrator._runTask (C:\**********\node_modules\orchestrator\index.js:273:3)
    at Gulp.Orchestrator._runStep (C:\**********\node_modules\orchestrator\index.js:214:10)
    at Gulp.Orchestrator.start (C:\**********\node_modules\orchestrator\index.js:134:8)
    at C:\**********\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)

I'm on Windows 10, if that matters. :/

1 Answer

Samuel Fortunato
Samuel Fortunato
20,229 Points

I am the BIGGEST IDIOT. In my gulpfile.js, instead of requiring del, I required def, and assigned it to del.

const del = require('def');

It works now.

Leaving my question here to show the importance of checking for dumb typos. WOW. Haha

Kjetil-Lennart A. Lorentzen
Kjetil-Lennart A. Lorentzen
13,390 Points

This made me smile, thank you. I don't feel so alone now