Skip to content

gulpInst.start.apply(gulpInst, toRun); TypeError: Cannot read property 'apply' of undefined #84

@kshitijbahul

Description

@kshitijbahul

I have the following entry in my package.json file
"gulp": "github:gulpjs/gulp#4.0"

i ran npm install -g "#4.0" and it gives me and error fatal: ambiguous argument '4.0': unknown revision or path not in the working tree.

Here is the error I get when I run gulp
**gulp
[02:49:31] Using gulpfile ~/Documents/XXXX/gulpfile.js
/usr/local/lib/node_modules/gulp/bin/gulp.js:129
gulpInst.start.apply(gulpInst, toRun);
^

TypeError: Cannot read property 'apply' of undefined
at /usr/local/lib/node_modules/gulp/bin/gulp.js:129:19
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Function.Module.runMain (module.js:577:11)
at startup (node.js:160:18)
at node.js:449:3**

Also The Output for gulp -v
gulp -v [02:55:57] CLI version 3.9.1
[02:55:57] Local version 4.0.0-alpha.2

Activity

phated

phated commented on Jun 24, 2016

@phated
Member

No idea why you are trying to install a branch that doesn't exist. Duplicate of #83

kshitijbahul

kshitijbahul commented on Jun 24, 2016

@kshitijbahul
Author

@phated : npm install -g "#4.0" was given as a solution for the issue
gulpInst.start.apply(gulpInst, toRun);
^

TypeError: Cannot read property 'apply' of undefined

Could you let me know how should I get past this then ?

kshitijbahul

kshitijbahul commented on Jun 24, 2016

@kshitijbahul
Author

@phated I did everything mentioned there
npm install gulp-cli and even tried adding "gulp-cli": "github:gulpjs/gulp-cli" to my package.json but i still get the issue

gulpInst.start.apply(gulpInst, toRun);
^

TypeError: Cannot read property 'apply' of undefined

Node version I am using is 6.2.0

phated

phated commented on Jun 24, 2016

@phated
Member

Please read the docs: https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md

This is not a support forum.

postor

postor commented on Aug 16, 2016

@postor

use local gulp-cli can make it run
node ./node_modules/gulp/bin/gulp.js

ElijahLynn

ElijahLynn commented on Aug 29, 2016

@ElijahLynn

Thanks @postor

I noticed my local gulp-cli version was 1.2.2 and my global version was 3.9.1. I checked NPM repo and latest suggested was 1.2.2, I have no idea how that happened but I did install gulp ages ago. I went ahead and installed gulp again globally and now I am at 1.2.2 and it works without that OP error.

jacksky007

jacksky007 commented on Sep 19, 2016

@jacksky007

I suffered the same issue in this case: install node and gulp(3.x) first, then remove node and install nvm instead, then install gulp-cli and gulp(4.0). After I removed the old gulp in /usr/local/bin, everything works.

anandchristal

anandchristal commented on Dec 21, 2016

@anandchristal

changed "gulp": "node node_modules/gulp/bin/gulp.js" in scripts:->under package.json
and also when run ....npm run gulp picked the local version

yairEO

yairEO commented on Jan 11, 2017

@yairEO

@anandchristal - please explain better. which package.json?
gulp's or your own?

what exactly did you change to what?

liratanak

liratanak commented on Jan 16, 2017

@liratanak

I ran into the similar issue (while was using http://fountainjs.io/ ):

/home/me/.nvm/versions/node/v6.9.2/lib/node_modules/gulp/bin/gulp.js:129
    gulpInst.start.apply(gulpInst, toRun);
                  ^

TypeError: Cannot read property 'apply' of undefined
    at /home/me/.nvm/versions/node/v6.9.2/lib/node_modules/gulp/bin/gulp.js:129:19
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

I tried:

npm i -g gulp-cli

Then error just gone :-)

Paqura

Paqura commented on Jan 19, 2017

@Paqura

npm i -g gulp-cli

it's rly working

shinusuresh

shinusuresh commented on Feb 4, 2017

@shinusuresh

npm i -g gulp-cli works for me too 👍

eliprodigy

eliprodigy commented on Feb 13, 2017

@eliprodigy

npm i -g gulp-cli works for me too 👍

added a commit that references this issue on Feb 15, 2017
asebold

asebold commented on Feb 16, 2017

@asebold

I was also getting this when trying to set up a new foundation site on linux. npm i -g gulp-cli fixed it.

locked and limited conversation to collaborators on Feb 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @postor@yairEO@phated@eliprodigy@ElijahLynn

        Issue actions

          gulpInst.start.apply(gulpInst, toRun); TypeError: Cannot read property 'apply' of undefined · Issue #84 · gulpjs/gulp-cli