gulpjs / vinyl

Virtual file format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Cannot find module './lib/cloneBuffer'

derekdowling opened this issue · comments

When I run this locally on OSX, I don't encounter this problem, but inside of Docker when this runs, I get:

NPM: 2.14.4
Node: 4.1.1
Gulp: 3.9.0

18:32:49 + ./node_modules/gulp/bin/gulp.js default
18:32:49 module.js:338
18:32:49     throw err;
18:32:49     ^
18:32:49 
18:32:49 Error: Cannot find module './lib/cloneBuffer'
18:32:49     at Function.Module._resolveFilename (module.js:336:15)
18:32:49     at Function.Module._load (module.js:286:25)
18:32:49     at Module.require (module.js:365:17)
18:32:49     at require (module.js:384:17)
18:32:49     at Object.<anonymous> (/dashboard/node_modules/gulp/node_modules/gulp-util/node_modules/vinyl/index.js:4:19)
18:32:49     at Module._compile (module.js:434:26)
18:32:49     at Object.Module._extensions..js (module.js:452:10)
18:32:49     at Module.load (module.js:355:32)
18:32:49     at Function.Module._load (module.js:310:12)
18:32:49     at Module.require (module.js:365:17)

Any thoughts on what might be causing this?

Most definitely docker 😛

I'm also not doing any sort of npm/bower install as part of the build process. I'm using folders sync to put all of the node_modules there so hypothetically the correct files should be there.

This file definitely should be, but you still need to do an install because gulp has native modules that it relies on which don't transfer systems well.

Would an npm rebuild suffice?

Late to the party but @derekdowling : Did you ever resolve this? I'm running into the same problem in docker and noticed vinyl only imported cloneBuffer, inspectStream, and isBuffer (Mine fails on ./lib/isStream).

@derekdowling Rebuild should suffice, closing this due to no new info

@Chrisell Seems like a problem in your folder syncing, as long as all of the files are there node should load everything just fine

@contra Yeah, so it seems. Unfortunately I can't seem to find out why the syncing is failing. I've tried doing an npm install within the compose and it still seems to be missing the same files.

Just wanted to mention that in my specific case, the vinyl module being found (and raising a ./lib/isStream not found error) was actually one installed by my host system's npm (on OS X) rather than the one installed by my docker container's npm. Once I figured that out and made sure that node was finding the one installed by my docker container, everything worked fine.