{"action":"created","issue":{"url":"https://api.github.com/repos/gulpjs/gulp/issues/867","labels_url":"https://api.github.com/repos/gulpjs/gulp/issues/867/labels{/name}","comments_url":"https://api.github.com/repos/gulpjs/gulp/issues/867/comments","events_url":"https://api.github.com/repos/gulpjs/gulp/issues/867/events","html_url":"https://github.com/gulpjs/gulp/issues/867","id":54195525,"number":867,"title":"Respect the explicitly set --cwd when --gulpfile argument is also set","user":{"login":"prodelay","id":5169378,"avatar_url":"https://avatars.githubusercontent.com/u/5169378?v=3","gravatar_id":"","url":"https://api.github.com/users/prodelay","html_url":"https://github.com/prodelay","followers_url":"https://api.github.com/users/prodelay/followers","following_url":"https://api.github.com/users/prodelay/following{/other_user}","gists_url":"https://api.github.com/users/prodelay/gists{/gist_id}","starred_url":"https://api.github.com/users/prodelay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prodelay/subscriptions","organizations_url":"https://api.github.com/users/prodelay/orgs","repos_url":"https://api.github.com/users/prodelay/repos","events_url":"https://api.github.com/users/prodelay/events{/privacy}","received_events_url":"https://api.github.com/users/prodelay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-01-13T13:50:55Z","updated_at":"2015-02-16T11:30:43Z","closed_at":null,"body":"When someone tries to run __Gulp__ with both `--cwd` and `--gulpfile` parameters set, __Gulp__ fails with _\"Local gulp not found in...\"_ error [because of](https://github.com/gulpjs/gulp-cli/blob/master/index.js#L88) undefined `env.modulePath`.\r\n\r\nThat is because __Liftoff__ [tries to resolve](https://github.com/tkellen/node-liftoff/blob/master/index.js#L89) `modulePath` with preference to `configBase` directory over `cwd`.\r\n\r\nIt was said ([by __tkellen__ here](https://github.com/tkellen/node-liftoff/issues/10#issuecomment-41284129)) that __Gulp__ should _\"respect its `cwd` choice and `chdir` to it\"_.\r\n\r\nCould it possibly be implemented?"},"comment":{"url":"https://api.github.com/repos/gulpjs/gulp/issues/comments/74494917","html_url":"https://github.com/gulpjs/gulp/issues/867#issuecomment-74494917","issue_url":"https://api.github.com/repos/gulpjs/gulp/issues/867","id":74494917,"user":{"login":"prodelay","id":5169378,"avatar_url":"https://avatars.githubusercontent.com/u/5169378?v=3","gravatar_id":"","url":"https://api.github.com/users/prodelay","html_url":"https://github.com/prodelay","followers_url":"https://api.github.com/users/prodelay/followers","following_url":"https://api.github.com/users/prodelay/following{/other_user}","gists_url":"https://api.github.com/users/prodelay/gists{/gist_id}","starred_url":"https://api.github.com/users/prodelay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prodelay/subscriptions","organizations_url":"https://api.github.com/users/prodelay/orgs","repos_url":"https://api.github.com/users/prodelay/repos","events_url":"https://api.github.com/users/prodelay/events{/privacy}","received_events_url":"https://api.github.com/users/prodelay/received_events","type":"User","site_admin":false},"created_at":"2015-02-16T11:30:43Z","updated_at":"2015-02-16T11:30:43Z","body":"@heikki, yeah, you are exactly right.\r\nThe reason to open that question was that (according to that docs) either `--cwd` or `--gulpfile` option is ignored.\r\n\r\nI believe that someone may want to take logic from `gulpfile.js` in __one__ folder, process it over the __other__ folder, while store all of his `node_modules` in the __third__ folder.\r\nI am [not alone](http://stackoverflow.com/questions/24398878/custom-gulpfile-path-that-is-not-an-ancestor-directory) here. :smirk:\r\n\r\nOf course, there are workarounds like, e.g. `process.chdir()`.\r\nI, personally, simlinked `node_modules` to `/` so `node` can find them no matter what (according to [nodejs.org/api/modules](http://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders)).\r\n\r\n@tkellen as to `liftoff-test` structure desired command may be like:\r\n\r\n    hacker --hackerfile sibling/hackerfile.js --cwd main/\r\n\r\n"}}