jackfranklin / gulp-load-plugins

Automatically load in gulp plugins
https://github.com/jackfranklin/gulp-load-plugins
MIT License
757 stars 55 forks source link

cannot find module xxx; env: win7 64 symbolic-link #41

Closed twlk28 closed 10 years ago

twlk28 commented 10 years ago
  1. i use mklink /d .\\node_modules <source> to create such a node_modules file, for some reason.
  2. cmd.exe throw an error : Cannot find module XXX. index.js@line50
  3. then, i calculate the absolute file path , like var absname = path.join(parentDir, 'node_modules', name); and return by requireFn, i worked. but i dont know why.
twlk28 commented 10 years ago

it is no problem (dont need calculate the absolute path) for mac symbolic-link

jackfranklin commented 10 years ago

Hey @twlk28,

Unfortunately I'm not able to test this on a Windows machine. I'm glad you've at least found a work around. If you're able to dig into this further let me know, I'd love to fix it if possible. It may be a problem though with symbolic links + Node generally though, rather than plugin specific.

twlk28 commented 10 years ago

thanks for your reply.

you are right. ^_^ when i rename the filename, which is the plugin's actual dir, something happen: case1 : mklink /d .\\node_modules C:\\lib not work case2 : mklink /d .\\node_modules C:\\node_modules worked!

seems in win32 , it resolve symlinks, then these is not such a dir named node_modules where the plugins' cwd , so the plugin can not find the brother modules ; and in mac, it did not resolve symlinks as expected.

relate issue https://groups.google.com/forum/#!topic/nodejs/HffaX_dsUxY