node.js - Cordova run ubuntu not work -
i installed ubuntu 14.04 , can not run application using "cordova run ubuntu", gives following error :
paulo@paulo-notebook:~/hello$ sudo cordova run ubuntu referenceerror: name not defined @ object.configparser.setdescription (/usr/local/lib/node_modules/cordova/src/configparser.js:70:45) @ object.module.exports.update_from_config (/usr/local/lib/node_modules/cordova/src/metadata/ubuntu_parser.js:74:21) @ object.module.exports.update_project (/usr/local/lib/node_modules/cordova/src/metadata/ubuntu_parser.js:156:21) @ /usr/local/lib/node_modules/cordova/src/prepare.js:113:31 @ _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) @ self.promisedispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) @ promise.promise.promisedispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) @ /usr/local/lib/node_modules/cordova/node_modules/q/q.js:821:14 @ flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) @ process._tickcallback (node.js:415:13)
and earlier gives following error when doing "cordova platform add ubuntu"
paulo@paulo-notebook:~/hello$ cordova platform add ubuntu downloading cordova library ubuntu... download complete checking ubuntu requirements... running "dpkg-query -wf'${db:status-abbrev}' cmake debhelper libx11-dev libicu-dev pkg-config qtbase5-dev qtchooser qtdeclarative5-dev qtfeedback5-dev qtlocation5-dev qtmultimedia5-dev qtpim5-dev qtsensors5-dev qtsystems5-dev 2>/dev/null | grep -q '^i'" (output follow) creating ubuntu project... shelljs module not found, running 'npm install'..... referenceerror: name not defined @ object.configparser.setdescription (/usr/local/lib/node_modules/cordova/src/configparser.js:70:45) @ object.module.exports.update_from_config (/usr/local/lib/node_modules/cordova/src/metadata/ubuntu_parser.js:74:21) @ object.module.exports.update_project (/usr/local/lib/node_modules/cordova/src/metadata/ubuntu_parser.js:156:21) @ /usr/local/lib/node_modules/cordova/src/prepare.js:113:31 @ _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) @ self.promisedispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) @ promise.promise.promisedispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) @ /usr/local/lib/node_modules/cordova/node_modules/q/q.js:821:14 @ flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) @ process._tickcallback (node.js:415:13)
does know can ?
this javascript bug of cordova can fix following next steps
$ sudo vim /usr/local/lib/node_modules/cordova/src/configparser.js
go line 69. here you'll find this:
setdescription: function() { this.doc.find('description').text = name; var el = findorcreate(this.doc, 'description'); },
the problem in line 70 caused variable called name
: undefined. fix bug need add name
input parameter of setdescription
function, this:
setdescription: function(name) { this.doc.find('description').text = name; var el = findorcreate(this.doc, 'description'); },
save changes. since ubuntu platform has been added - assume incorrectly - should go platforms directory of cordova project , delete ubuntu directory
$ cd ~/hello/platforms $ rm -r ubuntu
now need rerun:
$ cordova platform add ubuntu
finally should run without errors.
i've opened issue apache software fundation: https://issues.apache.org/jira/browse/cb-6643
Comments
Post a Comment