Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A36818BAD for ; Tue, 3 Nov 2015 00:45:28 +0000 (UTC) Received: (qmail 80725 invoked by uid 500); 3 Nov 2015 00:45:28 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 80697 invoked by uid 500); 3 Nov 2015 00:45:28 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 80684 invoked by uid 99); 3 Nov 2015 00:45:28 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 00:45:28 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D528D2C1F5F for ; Tue, 3 Nov 2015 00:45:27 +0000 (UTC) Date: Tue, 3 Nov 2015 00:45:27 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-9935) On Node.js version 5.0.0 Cordova CLI build, run and emulate commands don't work. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-9935?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1498638= 9#comment-14986389 ]=20 ASF GitHub Bot commented on CB-9935: ------------------------------------ GitHub user jasongin opened a pull request: https://github.com/apache/cordova-lib/pull/338 CB-9935: Cordova CLI silently fails on node.js v5 Cordova in a couple places was mis-using the Q.all() function from the Q promises library. That function expects an array (of values or promises), but Cordova was passing a single string parameter. The string was actually being reduced like an array. Previously that happened to work out OK: the result was an array of fulfilled single-character promises. But one line of code in Q that worked on node.js v4 now fails on node.js v5, where because of the bad parameter it ends up assigning a value to an index of the string: exception in cordova-lib\node_modules\q\q.js:1490 > promises[index] =3D value; TypeError: Cannot assign to read only property '0' of It appears the newer version of V8 is a little more strict about assigning to a string index. =20 The fix is simply to use Q() instead of Q.all() when the intention is to return a single fulfilled promise of type string. You can merge this pull request into a Git repository by running: $ git pull https://github.com/jasongin/cordova-lib CB-9935 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-lib/pull/338.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #338 =20 ---- commit 0f1eb6135725090af0af4fc82af29ca62645ed75 Author: Jason Ginchereau Date: 2015-11-03T00:29:55Z CB-9935: Cordova CLI silently fails on node.js v5 =20 Cordova in a couple places was mis-using the Q.all() function from the Q promises library. That function expects an array (of values or promises), but Cordova was passing a single string parameter. The string was actually being reduced like an array. Previously that happened to work out OK: the result was an array of fulfilled single-character promises. But one line of code in Q that worked on node.js v4 now fails on node.js v5, where because of the bad parameter it ends up assigning a value to an index of the string: exception in cordova-lib\node_modules\q\q.js:1490 > promises[index] =3D value; TypeError: Cannot assign to read only property '0' of It appears the newer version of V8 is a little more strict about assigning to a string index. =20 The fix is simply to use Q() instead of Q.all() when the intention is to return a single fulfilled promise of type string. ---- > On Node.js version 5.0.0 Cordova CLI build, run and emulate commands don'= t work. > -------------------------------------------------------------------------= ------- > > Key: CB-9935 > URL: https://issues.apache.org/jira/browse/CB-9935 > Project: Apache Cordova > Issue Type: Bug > Components: CLI > Affects Versions: 5.3.2 > Environment: Cordova CLI: 5.3.3 > Gulp version: CLI version 3.9.0 > Gulp local: Local version 3.9.0 > Ionic Version: 1.1.0 > Ionic CLI Version: 1.7.7 > Ionic App Lib Version: 0.6.3 > ios-deploy version: 1.8.2 > ios-sim version: 5.0.3 > OS: Mac OS X El Capitan > Node Version: v5.0.0 > Xcode version: Xcode 7.1 Build version 7B91b > Reporter: U=C4=9Fur Erkan > Assignee: Jason Ginchereau > > Cordova CLI with Node.js 5.0.0 build, run and emulate commands don't wor= k. There isn't any output even verbose mode. I can't find any debug output,= so sorry about lack of information. > Working workaround is node version switching, i'm using the n version man= ager. https://github.com/tj/n=20 > !https://i.imgur.com/1HG5ndp.png! > {color:red} > *It's affect Cordova CLI 5.3.3 version* > 5.3.3 is latest version on NPM https://www.npmjs.com/package/cordova > {color} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org