Ionic package build ios Failed Error: Cannot find module 'xcode'

Hi, could you help me, I’m trying to use ionic cloud packaging for my project and I get error when I run ionic package build ios

Failed to install ‘cordova-plugin-braintree’:Error: Cannot find module ‘xcode’
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object. (/Users/package/workspace/apps-6de78f93-2/cordova/plugins/cordova-plugin-braintree/scripts/add_embedded_ios_frameworks.js:3:15)
at Module._compile (module.js:556:32)
at Object.Module._extensions…js (module.js:565:10)
at Module.load (module.js:473:32)__emphasized text
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
Failed to restore plugin “cordova-plugin-braintree” from config.xml. You might need to try adding it again. Error: Error: Cannot find module ‘xcode’
Error: Cannot find module ‘xcode’

I use cordova-plugin-braintree which use ‘xcode’ package from node_modules. I have this package in package.json file Screenshot by Lightshot.
How I can solve this issue? thanks:)

1 Like

Could you resolve this issue? I got the same error in ionic package build with firebase-hooks cannot find module xcode and path seems be ok

Hi, I haven’t resolved this issue yet :frowning: I wrote to the ionic support, but they haven’t found a solution yet too.

I Solved this using the following combination. Check if this helps

cordova-ios@4.3.0
cordova@7.0.1