phonegap / node-phonegap-build

PhoneGap Build node module to login, create, and build apps.
Apache License 2.0
26 stars 25 forks source link

Build fails in node 10.12.0 #68

Closed sebastianjonasson closed 2 weeks ago

sebastianjonasson commented 5 years ago

OS: Ubuntu 16.04 Node: 10.12.0
Phonegap-cli: 8.0.0

Running phonegap --verbose remote build android returns the following output:

[phonegap] compressing the app...
[phonegap] uploading the app...
There was an unhandled exception within phonegap-cli! If you would like to help the PhoneGap project, please file the following details over at https://github.com/phonegap/phonegap-cli/issues
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at makeCallback (fs.js:137:11)
    at Object.rmdir (fs.js:664:14)
    at Object.cleanup (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/phonegap-build/create/zip.js:119:16)
    at Object.callback (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build/lib/phonegap-build/build/remote.js:71:21)
    at Request._callback (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/lib/api.js:230:26)
    at Request.self.callback (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/node_modules/request/main.js:122:22)
    at Request.emit (events.js:182:13)
    at Request.<anonymous> (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/node_modules/request/main.js:655:16)
    at Request.emit (events.js:187:15)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/phonegap/node_modules/phonegap-build-api/node_modules/request/main.js:617:14)

I was able to make it build by updating lib/phonegap-build/create/zip.js:119 from fs.rmdir(basepath); to fs.rmdirSync(basepath);. A dummy callback (() => 1) did the trick as well.

jgroot24 commented 5 years ago

Same here OS: High Sierra 10.13.5 Node: 10.5.0 cli: 8.0.0

gust42 commented 5 years ago

Made a quick fix in

69

shubhambaghel34 commented 4 years ago

I am facing this issue while running the command "PhoneGap remote build android".

image