Closed rmorlang closed 9 years ago
@rleemorlang I think that V0.10 will solve this if I've understood. If it doesn't please reopen.
I'm still seeing this issue. I'm using 1.1.0.
@eborden going to need some more info - can you get a repo that replicates this issue up for us to take a look at? Do you see the exact same error as above? A stack trace would be useful.
The error is slightly different. My guess is that this is actually a problem with resolve
not correctly handling $NODE_PATH
. When using require
these plugins load perfectly, but fail with gulp-load-plugins.
/nix/store/c4fa8kybxzfbr6x1fpxm25wmxz5kcq7r-narsDeps/node_modules/resolve/lib/sync.js:33
throw new Error("Cannot find module '" + x + "' from '" + y + "'");
^
Error: Cannot find module 'gulp-cli' from '/home/eborden/skedge/skedge/widgets/nars'
at Function.module.exports [as sync] (/nix/store/c4fa8kybxzfbr6x1fpxm25wmxz5kcq7r-narsDeps/node_modules/resolve/lib/sync.js:33:11)
at requireFn (/nix/store/c4fa8kybxzfbr6x1fpxm25wmxz5kcq7r-narsDeps/node_modules/gulp-load-plugins/index.js:46:25)
at defineProperty (/nix/store/c4fa8kybxzfbr6x1fpxm25wmxz5kcq7r-narsDeps/node_modules/gulp-load-plugins/index.js:89:29)
at /nix/store/c4fa8kybxzfbr6x1fpxm25wmxz5kcq7r-narsDeps/node_modules/gulp-load-plugins/index.js:120:7
at Array.forEach (native)
at module.exports (/nix/store/c4fa8kybxzfbr6x1fpxm25wmxz5kcq7r-narsDeps/node_modules/gulp-load-plugins/index.js:110:30)
at Object.<anonymous> (/home/eborden/skedge/skedge/widgets/nars/gulpfile.js:12:51)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
It'll take a little more effort for me to create a repo to reproduce this, but I'll see if I can get to it today.
@eborden perfect, thank you. Might be a bug in resolve but happy to do digging if you can get a repo, thanks :)
Any updates on this ? Where did it get up to? I'm getting a similar error…
@Chrisedmo I have never had this error + have not been able to replicate. I also don't work on this project much or use Gulp these days. I'm afraid I need some help with this. If people can give me a Github repo that shows the issue easily I might be able to dig into it, or if someone else can figure it and make a PR that's great, I'd love to merge it, but the chances of me fixing it soon are slim to none.
The application I'm working on is being integrated into a build environment that requires that all external dependencies live in a separate directory hierarchy. So this means I've had to move
node_modules
from the root directory of my application into a path like/home/user/libraries/node_modules
. Generally this means just setting theNODE_PATH
environment variable to$NODE_PATH:/home/user/libraries/node_modules
. This works fine for loading gulp, but it breaks with gulp-load-plugins.This seems to be a result of the changes introduced in 05bc2845, which addresses issues #56 and #57. gulp-load-plugins searches up through the directory hierarchy to try to find plugins, but if no matching plugin path is found
findup()
returnsnull
, and so gulp-load-plugins ends up invokingrequire(null)
, resulting in the following error:I have a PR in progress.