Closed klierik closed 9 years ago
Have you globally installed it too?
$ npm install -g gulp
Yes, i am:
$ cd && gulp -v
[12:11:03] CLI version 3.8.11
Your gulpfile is wayyy too deep and your node_modules are way too high up the tree. node only looks up a few directories for node_modules before saying it couldn't find it. Look at the npm/node docs for more info, but it needs to be closer.
Oh, i understand what you mean. You are wright. Thanks a loooot!
Your gulpfile is wayyy too deep and your node_modules are way too high up the tree. node only looks up a few directories for node_modules before saying it couldn't find it. Look at the npm/node docs for more info, but it needs to be closer.
I don't think it's true.
$ pwd
/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/5/4/3/2/1/0
$ ls
gulpfile.js
$ strace -e file gulp |& grep gulp.js
readlink("/srv/pyramid/smms-client-nosite/lib/node_modules/.bin/gulp", "../gulp/bin/gulp.js", 4096) = 19
lstat("/srv/pyramid/smms-client-nosite/lib/node_modules/gulp/bin/gulp.js", {st_mode=S_IFREG|0755, st_size=5384, ...}) = 0
open("/srv/pyramid/smms-client-nosite/lib/node_modules/gulp/bin/gulp.js", O_RDONLY|O_CLOEXEC) = 9
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/5/4/3/2/1/0/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/5/4/3/2/1/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/5/4/3/2/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/5/4/3/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/5/4/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/5/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/6/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/7/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/8/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/9/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/10/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/11/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/12/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/13/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/14/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/15/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/dir-test/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/tmp/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
stat("/node_modules/gulp.js", 0x7ffc49012d20) = -1 ENOENT (No such file or directory)
I get the same result for 100 subdirectories.
Don't you think it's a security risk to search for node_modules
in upper directories (infinite or arbitrary number of levels)?
@wodny This is behavior in node, not something that we did - if you feel like this is a problem you should open an issue with the node.js team about it
@contra I see. Thank you for the information.
I am learning about gulp and trying to follow some instructions on how to get gulpfile to read, instead of no file found...I am currently getting this error:
C:\dev\vstda>gulp module.js:457 throw err; ^
Error: Cannot find module 'gulpfile.js' at Function.Module._resolveFilename (module.js:455:15) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Liftoff.handleArguments
I don't understand where the problem is coming from?
Re-installing at a higher level worked for me. I'm not sure which was important to run, but I ran both $sudo npm install -g gulp@latest and $sudo npm install -g npm@latest, then $ionic serve finally stopped saying that gulp module was missing.
It seem is npm's problem.I couldn't find the file in the dictionary of gulp.But I want to know how to solve this problem.Install the latest gulp version?
I tried "npm update" command and it worked
Hi, i had the same problem only i was trying to use gulp awtch and it couldnt finde the moduels. Luckuly i fixed it. My problem for this was that i had multiple files with the name gulp, so when i tried to use gulp watch this happened:
internal/modules/cjs/loader.js:883 throw err; ^
Error: Cannot find module 'gulp-cli' Require stack:
when i used the "npm install --global gulp-cli" command in the terminal it showed me errors that sed that i all ready have files called gulp and told me all of the locations of the, so i deleted all of them and then ran the command again npm install --global gulp-cli and it works now. I hope this helps somebody.
Good day.
I have problem with gulp + gulpfile as symlink :(
Project folder:
So let`s check modules:
Let`s run gulp:
In gulpfile.js on row 13:
var gulp = require('gulp');
I don`t understand where is the problem... :(
Maybe anyone can see some problem that i don`t see... ?!
Thaks