blakgeek / cordova-plugin-cocoapods-support

A Cordova/PhoneGap plugin to add support for CocoaPods dependencies.
MIT License
72 stars 72 forks source link

undefined is not a function when installing plugin #4

Closed jgimenez closed 8 years ago

jgimenez commented 8 years ago

It looks like this error happens when using an old version of nodejs. It took me quite some time to realize what was going wrong, maybe you can throw a meaningful error or refuse to install on old node.js versions (I know little node, so I don't know exactly how you would implement this).

Error: TypeError: undefined is not a function
    at /Users/xxx/plugins/cordova-plugin-cocoapod-support/scripts/podify.js:182:21
    at /Users/xxx/plugins/cordova-plugin-cocoapod-support/node_modules/command-exists/lib/command-exists.js:11:13
    at ChildProcess.exithandler (child_process.js:635:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

My suspicion is that child_process is not present in old versions of node.

blakgeek commented 8 years ago

Which version of node are you using?

On Fri, Aug 5, 2016 at 9:16 AM, Jordi Giménez Gámez < notifications@github.com> wrote:

It looks like this error happens when using an old version of nodejs. It took me quite some time to realize what was going wrong, maybe you can throw a meaningful error or refuse to install on old node.js versions (I know little node, so I don't know exactly how you would implement this).

Error: TypeError: undefined is not a function at /Users/xxx/plugins/cordova-plugin-cocoapod-support/scripts/podify.js:182:21 at /Users/xxx/plugins/cordova-plugin-cocoapod-support/node_modules/command-exists/lib/command-exists.js:11:13 at ChildProcess.exithandler (child_process.js:635:7) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) at Socket. (child_process.js:948:11) at Socket.EventEmitter.emit (events.js:95:17) at Pipe.close (net.js:466:12)

My suspicion is that child_process

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blakgeek/cordova-plugin-cocoapod-support/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AAyU3gEesWHWOJlKKKyleeOYe7oky57Tks5qczfCgaJpZM4Jdq82 .

Want to waste some time or challenge your mental skills? Check out my games on www.bggamecentral.com or download them from the App Stores https://itunes.apple.com/us/artist/henry-lawton/id895605107 [image: https://play.google.com/store/search?q=pub:BG%20Games&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1] https://play.google.com/store/search?q=pub:BG%20Games&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1 Get it on Google https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png

jgimenez commented 8 years ago

I was using v0.10.23 when I got the problem.

jgimenez commented 8 years ago

Wow, that was fast!! 👍

blakgeek commented 8 years ago

I removed the use of execSync which is only available in node v0.11.12 or later. Version 1.2.6 of the plugin or later should work for you. Let me know if you still have issues.

blakgeek commented 8 years ago

Don't use that version.

blakgeek commented 8 years ago

There was a bug in 1.2.6 that prevented the ios project from building and produced no output. Please use version 1.2.8 or later.