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)

5 Answers 5

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
4
  • this keeps hapening each time after I run the gulp task, I uninstall then install and again I get the error Commented Aug 21, 2016 at 7: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. Commented Jan 27, 2017 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'. Commented Jan 31, 2017 at 18:47
  • @TzookBarNoy I too am having the same issue. Did you resolve it by any chance?
    – Mark
    Commented May 18, 2017 at 20:07
3

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

0
1

node node_modules/gulp/bin/gulp.js YOURTASKNAME

or

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

1
  • 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. Commented Nov 7, 2017 at 9:20
0

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.