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:\Users
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
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:
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.
@ChALkeR Not really https://github.com/nodejs/io.js/issues/1941
@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.
Most helpful comment
I had the same problem too when I build Semantic-UI
I used those
and fixed it.