Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Cannot read property 'apply' of undefined #61

Closed
digitalclover opened this issue Jul 14, 2016 · 15 comments
Closed

Cannot read property 'apply' of undefined #61

digitalclover opened this issue Jul 14, 2016 · 15 comments
Labels

Comments

@digitalclover
Copy link

I am using Pattern Lab Node v6.2.2 on Windows & Mac, using the gulp configuration.

Expected Behavior

After installing npm packages, gulp should be able to perform its defined tasks in /gulpfile.js

Actual Behavior

All gulp tasks results in thrown error.
Full output:

Loading engines...
...scanning for engines in the core...
- mustache engine: good to go
...scanning for engines in the edition or test directory...
...done loading engines.

[10:25:17] Using gulpfile ~/[...]/edition-node-gulp/gulpfile.js
/[...]/node_modules/gulp/bin/gulp.js:129
    gulpInst.start.apply(gulpInst, toRun);
                  ^

TypeError: Cannot read property 'apply' of undefined
    at /opt/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 Module.runMain (module.js:577:11)
    at run (node.js:348:7)
    at startup (node.js:140:9)
    at node.js:463:3
Steps to Reproduce

Issue is duplicated on both Windows 10 & OSX

  1. Clone git repository
  2. Run 'npm install' (gulp already installed globally)
  3. Run any gulp command
@bmuenzenmeyer
Copy link
Member

Hi @digitalclover thanks for the issue report.

My current guess is this is an environment thing. I can run the repo clean on Node 5.5.0 but don't have ncu on my work rig to try it at Node 6.X yet.

Pattern Lab Core is covered by travis, but the editions are not yet.
Sit tight!

@bmuenzenmeyer
Copy link
Member

could you also provide the results of gulp -v ?

@levimcg
Copy link

levimcg commented Jul 14, 2016

Hey, @bmuenzenmeyer I'm getting the same error shown above. Here's my results from gulp -v

CLI version 3.9.1
Local version 4.0.0-alpha.2

Thanks, really looking forward to checking out Patternlab!

@bmuenzenmeyer
Copy link
Member

Your gulp CLI is wrong.

https://github.com/pattern-lab/edition-node-gulp/wiki/Updating-to-Gulp-4

@levimcg
Copy link

levimcg commented Jul 14, 2016

Yep, just realized that. Sorry! Everything is working fine now. Thanks for the reply.

@bmuenzenmeyer
Copy link
Member

Yay! Finding the ways in which this error manifests is important for future users. Thanks again for taking the time to use Pattern Lab!

@digitalclover
Copy link
Author

Confirmed that I had Gulp 3.x running on both machines. Upgrading to 4.x fixed this issue. Thank you.

@bmuenzenmeyer
Copy link
Member

lol i didn't realize there was two of you, but nice that it resolved both of your issues.

@skyelves
Copy link

I have tried the method you mentioned, but my CLI version is still 3.9.1.
Is that something wrong with my node version(6.9.5)?

@encrypted-yknev
Copy link

After upgrading my gulp-cli version, gulp -v still shows the same
[00:13:30] CLI version 3.9.1 [00:13:30] Local version 4.0.0

Any suggestions what can be the issue?

node -v : v7.10.1
npm -v : v4.2.0

@sabbiseaan
Copy link

npm i -g gulp-cli
is fix my issue

@bmuenzenmeyer
Copy link
Member

bmuenzenmeyer commented Aug 18, 2018

What folks most likely want is npm install --save-dev gulp@next

pretty quick troubleshooting output below

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ gulp -v
[15:18:50] CLI version 2.0.1

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ gulp patternlab:serve
[15:18:55] Local gulp not found in D:\src\pl-migrate-example
[15:18:55] Try running: npm install gulp

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ npm install gulp
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, follo                                                                  wing the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for comp                                                                  atibility with current and future versions of Node.js
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher                                                                   to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher                                                                   to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compa                                                                  tibility with current and future versions of Node.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fse                                                                  vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@                                                                  1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}                                                                  )

+ gulp@3.9.1
added 243 packages in 26.565s

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ gulp patternlab:serve
Loading engines from the core...


Loading engines from the edition or test directory...

  mustache: good to go

Done loading engines.


====[ Pattern Lab / Node - v2.12.0 ]====

D:\src\pl-migrate-example\gulpfile.js:87
  gulp.parallel(
       ^

TypeError: gulp.parallel is not a function
    at Object.<anonymous> (D:\src\pl-migrate-example\gulpfile.js:87:8)
    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)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at execute (C:\Users\brian\AppData\Roaming\nvm\v8.9.4\node_modules\gulp-cli\                                                                  lib\versioned\^3.7.0\index.js:28:18)
    at Liftoff.handleArguments (C:\Users\brian\AppData\Roaming\nvm\v8.9.4\node_m                                                                  odules\gulp-cli\index.js:175:63)

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ ^C

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ gulp -v
[15:20:05] CLI version 2.0.1
[15:20:05] Local version 3.9.1

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ npm install gulp@next
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fse                                                                  vents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@                                                                  1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}                                                                  )

+ gulp@4.0.0
added 141 packages, removed 64 packages and updated 12 packages in 24.256s

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ gulp -v
[15:21:40] CLI version 2.0.1
[15:21:40] Local version 4.0.0

brian@DESKTOP-TCM0GPM MINGW32 /d/src/pl-migrate-example (master)
$ gulp patternlab:serve
Loading engines from the core...


Loading engines from the edition or test directory...

  mustache: good to go

Done loading engines.


====[ Pattern Lab / Node - v2.12.0 ]====

... etc

@dhirendrapratapsingh
Copy link

I tried everythinbg in sequence from above nothing worked

After upgrading my gulp-cli version, gulp -v still shows the same
still its showing
gulp -v
[16:40:55] CLI version 3.9.1
[16:40:55] Local version 4.0.0

npm install --save-dev gulp@next did not work showed this
Screenshot from 2019-04-19 16-42-05

@submagr
Copy link

submagr commented May 7, 2019

Even I tried everything mentioned above:

npm uninstall gulp
npm uninstall -g gulp-cli
npm install -g gulp-cli
npm install gulp

But the error still persisted.

The following things worked for me:
Manually delete gulp and gulp-cli, packages and binaries from everywhere:

  1. ~/.nvm/versions/node/v12.1.0/bin
  2. ~/.nvm/versions/node/v12.1.0/lib/node_modules
  3. /usr/local/bin
  4. /usr/local/lib/node_modules/

I think the difference between package install locations of nvm and default node was messing up for me.

@nolawnchairs
Copy link

Same issue.

CLI version 3.9.1
Local version 4.0.2

Still get this error
uninstalled gulp locally
uninstalled gulp globally
uninstalled gulp-cli globally
rm -rf'ed node_modules
uninstalled node, reinstalled node
reinstalled operating system, changed internet providers, moved house, got a sex change
STILL not working.

@pattern-lab pattern-lab locked as resolved and limited conversation to collaborators Dec 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants