question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gulp-cli fails if local gulp is 4.0

See original GitHub issue

Within my project’s package.json I have:

json
"dependencies": {
  "gulp": "git+https://github.com/gulpjs/gulp.git#4.0"
}

If I globally install stable gulp (3.X) and run gulp it fails (known issue, ok). But if I globally install gulp-cli it also fails:

bash
$ gulp
[15:59:34] Using gulpfile ~/src/XXX/gulpfile.js

/Users/xxxxxx/.npm-packages/lib/node_modules/gulp-cli/index.js:133
    gulpInst.start.apply(gulpInst, toRun);
                   ^
TypeError: Cannot call method 'apply' of undefined
    at /Users/xxxxxx/.npm-packages/lib/node_modules/gulp-cli/index.js:133:20
    at process._tickDomainCallback (node.js:463:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3

I fail to understand the purpose of gulp-cli if it fails in this scenario. Do I miss something?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

39reactions
rajathmscommented, Nov 30, 2016

@xzegga yep I resolved it , it’s working.

Bring back your CLI version to 1.2.2 it will support gulp 4, and will solve your problem.

to install gulp-cli 1.2.2 run sudo npm install gulp-cli@1.2.2 -g and to install gulp local run npm install 'gulpjs/gulp.git#4.0' --save-dev

when you run gulp -v command

you should get [11:38:36] CLI version 1.2.2 [11:38:36] Local version 4.0.0-alpha.2

13reactions
Niceplacecommented, Nov 12, 2016

I confirm that the solution proposed by @rajathms works !

I did : sudo npm install gulp-cli@1.2.2 -g

Read more comments on GitHub >

github_iconTop Results From Across the Web

gulp command not found - error after installing gulp
If you get gulp local version not found exit the current Node.js command prompt and try the above command in a new Node.js...
Read more >
How to fix "Local gulp not found" error message
When trying to run Gulp on the command line, are you getting an error saying Local gulp not found ? Even if you...
Read more >
Mea culpa - always install gulp-cli globally, not gulp
This is a story about a mea culpa. You should install the gulp-cli package globally, not gulp globally. To better understand why, ...
Read more >
command not found: gulp - theUnknown - Medium
Tried to install gulp-cli globally and failed with the following error: ... gulp -v[19:43:16] CLI version 3.9.1[19:43:16] Local version 4.0.0.
Read more >
Quick Start | gulp.js
If you've previously installed gulp globally, run npm rm --global gulp before following these ... Output: CLI version 2.0.1 & Local version 4.0.0 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found