You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Craig Payne (JIRA)" <ji...@apache.org> on 2014/11/03 18:24:33 UTC

[jira] [Updated] (CB-7928) --copy-from fails with "SyntaxError: Unexpected token -"

     [ https://issues.apache.org/jira/browse/CB-7928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Payne updated CB-7928:
----------------------------
          Component/s: CLI
          Description: 
$ cordova create name com.name.app NAME —-copy-from ~/Cordova/Cordova-4.0.0-Examples/Cordova-Examples/barcode/
SyntaxError: Unexpected token —
    at Object.parse (native)
    at cli (/usr/local/lib/node_modules/cordova/src/cli.js:230:24)
    at Object.<anonymous> (/usr/local/lib/node_modules/cordova/bin/cordova:41:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3
$ cordova -v
4.0.0

I have a fresh copy of The Examples:

$ git clone https://github.com/cfjedimaster/Cordova-Examples.git 
Cloning into 'Cordova-Examples'...
remote: Counting objects: 191, done.
remote: Total 191 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (191/191), 1.19 MiB | 512.00 KiB/s, done.
Resolving deltas: 100% (35/35), done.
Checking connectivity... done.
$

I had just updated (cleanly on the 3rd try) to Cordova 4.0.0.  My copy of cli.js has this at line 230:

    } else if (cmd == 'create') {
        var cfg = {};
        // If we got a fourth parameter, consider it to be JSON to init the config.
        if ( undashed[4] ) {
            cfg = JSON.parse(undashed[4]);  <--- line 230
        }
             Priority: Minor  (was: Major)
          Environment: MacOS 10.9.5
    Affects Version/s: 4.0.0
              Summary: --copy-from fails with "SyntaxError: Unexpected token -"  (was: --copy-from fails with "SyntaxError: Unexpected token —)

> --copy-from fails with "SyntaxError: Unexpected token -"
> --------------------------------------------------------
>
>                 Key: CB-7928
>                 URL: https://issues.apache.org/jira/browse/CB-7928
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>    Affects Versions: 4.0.0
>         Environment: MacOS 10.9.5
>            Reporter: Craig Payne
>            Priority: Minor
>
> $ cordova create name com.name.app NAME —-copy-from ~/Cordova/Cordova-4.0.0-Examples/Cordova-Examples/barcode/
> SyntaxError: Unexpected token —
>     at Object.parse (native)
>     at cli (/usr/local/lib/node_modules/cordova/src/cli.js:230:24)
>     at Object.<anonymous> (/usr/local/lib/node_modules/cordova/bin/cordova:41:1)
>     at Module._compile (module.js:456:26)
>     at Object.Module._extensions..js (module.js:474:10)
>     at Module.load (module.js:356:32)
>     at Function.Module._load (module.js:312:12)
>     at Function.Module.runMain (module.js:497:10)
>     at startup (node.js:119:16)
>     at node.js:902:3
> $ cordova -v
> 4.0.0
> I have a fresh copy of The Examples:
> $ git clone https://github.com/cfjedimaster/Cordova-Examples.git 
> Cloning into 'Cordova-Examples'...
> remote: Counting objects: 191, done.
> remote: Total 191 (delta 0), reused 0 (delta 0)
> Receiving objects: 100% (191/191), 1.19 MiB | 512.00 KiB/s, done.
> Resolving deltas: 100% (35/35), done.
> Checking connectivity... done.
> $
> I had just updated (cleanly on the 3rd try) to Cordova 4.0.0.  My copy of cli.js has this at line 230:
>     } else if (cmd == 'create') {
>         var cfg = {};
>         // If we got a fourth parameter, consider it to be JSON to init the config.
>         if ( undashed[4] ) {
>             cfg = JSON.parse(undashed[4]);  <--- line 230
>         }



--
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