22

I am getting this error Cannot find module '../lib/completion' however I have installed completion and completion.js is present in the lib file.

->gulp compile
module.js:327
    throw err;
    ^

Error: Cannot find module '../lib/completion'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (D:\wamp23\www\mfe\ref\gulpfile.js:13:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
gnerkus
  • 11,357
  • 6
  • 47
  • 71
Utpal - Ur Best Pal
  • 4,472
  • 3
  • 17
  • 28

5 Answers5

44

I was unable to determine the cause of the issue. However, an uninstall then reinstall of gulp solved it.

Uninstall:

npm uninstall gulp --save

Re-install:

npm install gulp --save
gnerkus
  • 11,357
  • 6
  • 47
  • 71
  • this keeps hapening each time after I run the gulp task, I uninstall then install and again I get the error – Tzook Bar Noy Aug 21 '16 at 07:37
  • What kind of file system events might cause this? Said differently, I too am experiencing this problem. But since my code is in a DropBox folder that is constantly being synced, I wonder if Dropbox is causing the problem. – Professor Tom Jan 27 '17 at 17:40
  • While this solution works, I wanted to add what I'm doing that is causing me to have to uninstall and reinstall `gulp`: I press `Control + C` to end running gulp tasks. Then the next gulp task I try to execute gives the error message `Error: Cannot find module '../lib/completion'`. – Professor Tom Jan 31 '17 at 18:47
  • @TzookBarNoy I too am having the same issue. Did you resolve it by any chance? – MarkB May 18 '17 at 20:07
3

I removed the entire node_modules/ folder, and did a reinstall, which solved the problem.

Julian Gong
  • 360
  • 2
  • 8
1

node node_modules/gulp/bin/gulp.js YOURTASKNAME

or

uninstall the local gulp and install again, which will solve the problem.

  • 1
    usual problem when installing gulp locally in some other pc or location and copy/move the project(node_modules) to new location, causing this issue. – user8899119 Nov 07 '17 at 09:20
0

problem in gulp module so, uninstall and install the module.

KARTHIKEYAN.A
  • 18,210
  • 6
  • 124
  • 133
0

I was having the same issue uninstalling and reinstalling the gulp module didn't help for me I then removed the node_modules folder and did npn install it seems to be working now.

Sam Kaz
  • 432
  • 3
  • 12