Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--gulpfile and --cwd not working as expected #2126

Closed
trusktr opened this issue Feb 11, 2018 · 2 comments
Closed

--gulpfile and --cwd not working as expected #2126

trusktr opened this issue Feb 11, 2018 · 2 comments

Comments

@trusktr
Copy link

trusktr commented Feb 11, 2018

Based on #122, I'm trying to use --gulpfile and --cwd without luck.

Are you trying to look up folders or down folders for a gulpfile?

I'm trying to look up folders.

I have this structure:

project # I want to run gulp in here
  package.json # has gulp dependency
  node_modules # local gulp install here
  src/ # source files
otherFolder
  gulpfile.js 

where project is the folder I'm in while at the command line, then I'm running this:

gulp --cwd ./ --gulpfile ../otherFolder/gulpfile.js

but it gives me this error:

trusktr@DESKTOP-7H13Q4E:/path/to/project$ gulp --cwd ./ --gulpfile ../otherFolder/gulpfile.js
[14:07:29] Local gulp not found in /path/to/project
[14:07:29] Try running: npm install gulp

although, gulp is installed in the project:

trusktr@DESKTOP-7H13Q4E:/path/to/project$ ls -ld node_modules/gulp/
drwxrwxrwx 0 root root 4096 Feb 11 12:41 node_modules/gulp/

What I'm really trying to do is use Builder to share common configuration across projects and packages, so I'd like to ship a gulpfile.js inside an NPM package and share it (this is called an "archetype" in Builder).

If I link my "archetype" package into my project, so that it will be inside of node_modules, and therefore I am looking down for the gulpfile, still no luck:

trusktr@DESKTOP-7H13Q4E:/path/to/project$ gulp --cwd ./ --gulpfile node_modules/builder-js-package/config/gulpfile.js
module.js:540
    throw err;
    ^

Error: Cannot find module 'gulp'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/mnt/d/src/trusktr+builder-js-package/config/gulpfile.js:1:76)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)

where builder-js-package is the name of my "archetype".

Basically, --gulpfile and --cwd just doesn't seem to work like expected.

@trusktr trusktr changed the title Unable to use --gulpfile and --cwd to do what I need. --gulpfile and --cwd not working as expected Feb 11, 2018
@phated
Copy link
Member

phated commented Feb 11, 2018

Don't believe this is possible because no one ever submitted a patch for gulpjs/liftoff#55.

I'm not particularly fond of creating separate gulpfiles in other packages and using them - instead, you should create a Custom Registry for gulp 4 and share that.

@phated
Copy link
Member

phated commented Feb 11, 2018

Pinging @sttk to make sure I'm correct on that first part.

@phated phated closed this as completed Feb 11, 2018
@gulpjs gulpjs locked as spam and limited conversation to collaborators Feb 11, 2018
@gulpjs gulpjs deleted a comment from trusktr Feb 11, 2018
@gulpjs gulpjs deleted a comment from trusktr Feb 11, 2018
@gulpjs gulpjs deleted a comment from trusktr Feb 11, 2018
@gulpjs gulpjs deleted a comment from trusktr Feb 11, 2018
@gulpjs gulpjs deleted a comment from trusktr Feb 11, 2018
@gulpjs gulpjs deleted a comment from trusktr Feb 11, 2018
@gulpjs gulpjs deleted a comment from trusktr Feb 11, 2018
@gulpjs gulpjs unlocked this conversation Feb 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants