Gulp: Cannot find module 'clone' (Gulp 3.9.0)

Created on 15 Jun 2015  路  14Comments  路  Source: gulpjs/gulp

I am using Windows 8.1 and Gulp 3.9.0, and I have just updated to io.js 2.3.0. When trying to run gulp in my project after the update, I receive the following message:

Cannot find module 'clone'

Inside the following path:

C:\UsersAppData\Roaming\npm\node_modules\gulp\node_modules\gulp-util\node_modules\vinylindex.js:2:13

The full log is this:

Error: Cannot find module 'clone'
    at Function.Module._resolveFilename (module.js:332:15)
    at Function.Module._load (module.js:282:25)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\<username>\AppData\Roaming\npm\node_modules\gulp\node_modules\gulp-util\node_modules\vinyl\index.js:2:13)
    at Module._compile (module.js:426:26)
    at Object.Module._extensions..js (module.js:444:10)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
    at Module.require (module.js:361:17)

I'm not sure what to do. Could you please help me?

Thanks

Most helpful comment

I had the same problem too when I build Semantic-UI

$ gulp build
module.js:327
    throw err;
    ^

Error: Cannot find module 'gulp-clone'
    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> (/home/bllli/PycharmProjects/ReverseCourse/frontend/semantic/tasks/watch.js:15: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)

I used those

$ sudo npm install clone
$ sudo npm install gulp-clone

and fixed it.

All 14 comments

What happens if you delete your gulp install using npm rm and then reinstall it?

Your install failed, npm installs are very unreliable. Delete it and try again.

I have completely removed all my global modules and even used npm cache clean. I have reinstalled the modules with my user and as administrator. I have done it globally and in my project directory and nothing happens. The error is still there.

I have try to install gulp with an older version of io.js and then, I have try to run gulp with the following versions of io.js (without reinstalling gulp) and the result has been the following:

  • iojs-v2.0.2-x64 --> working
  • iojs-v2.1.0-x64 --> working
  • iojs-v2.2.0-x64 --> failed
  • iojs-v2.2.1-x64 --> failed
  • iojs-v2.3.0-x64 --> failed

so it seems like an issue with iojs compatibility with npm - can you post the log from when you run npm install gulp ?

@contra io has been busting npm in a bunch of versions, do we really want to start tackling this stuff?

As soon as I arrive home. I have there my PC. Meanwhile, I have opened this issue too in IO.js: Gulp dependencies not found #1980, just in case it could help. Your module is not the only one broken. Mock-fs and Semantic-UI seem to have similar problems too.

mock-fs is monkey-patching fs, that voids all warranties, so it's their fault.
As for Semantic-UI, that bug is from 26 February, so it must have a different cause.

@callumacrae Are you implying that monkey-patching is (or should be) supported?

Example: new methods could be introduced in minor versions, and is someone monkey-patches the old methods, new methods could go around that. So it means that monkey-patching is not safe from breaking in a minor version by design.

No, but I'm saying you shouldn't blame module authors for making modules that are made necessary because the core lacks functionality, and when _npm itself_ relies on one such module, it's definitely in the interests of the core contributors to avoid breaking it.

That's not a discussion for here, though.

Seems to be an io.js/npm bug so I am going to close this - we are not on the io or npm teams and won't be fixing bugs in those projects

I had the same problem, I fix it putting: npm install clone

If you have another error module just try to install it with: npm install [module name] and that's it

I had the same problem too when I build Semantic-UI

$ gulp build
module.js:327
    throw err;
    ^

Error: Cannot find module 'gulp-clone'
    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> (/home/bllli/PycharmProjects/ReverseCourse/frontend/semantic/tasks/watch.js:15: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)

I used those

$ sudo npm install clone
$ sudo npm install gulp-clone

and fixed it.

I tried all the steps above and wasn't able to fix it. Turns out, moving (in my case, since it is dependent on clone) browser-sync to devDependencies in my package.json solved it. Just wanted to post in case anyone else runs into this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronroberson picture aaronroberson  路  4Comments

borodean picture borodean  路  5Comments

tom10271 picture tom10271  路  4Comments

zellwk picture zellwk  路  3Comments

joe-watkins picture joe-watkins  路  5Comments