Uploaded image for project: 'Appcelerator CLI'
  1. Appcelerator CLI
  2. CLI-1233

If you build appc-cli with NPM 3.X and Node 6.10.3, then you will get ""listener" argument must be a function"" when creating a mobile project


    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: CLI Release 7.1.0
    • Component/s: Core
    • Labels:
    • Environment:

      NPM: 3.10.10
      Node: 6.10.3
      appc-cli: lastest from repo

    • Severity:
    • Story Points:


      Details: If you build appc-cli with NPM 3.X and Node 6.10.3, then you will get "listener" argument must be a function error when creating a mobile project.


      Technical Notes:

      Steps to reproduce:

      1. Clone https://github.com/appcelerator/appc-cli
      2. From terminal, run the following commands in the appc-cli repo:

        # you don't need to delete this if this is your first time cloning the repo
        rm -rfv node_modules
        # you can move the json file instead of deleting it
        rm npm-shrinkwrap.json
        # at this point, you're performing a simplified version of what Jenkins does starting here: https://github.com/appcelerator/jenkins_dsl/blob/master/jobs/appc_cli.groovy#L55
        npm cache clean
        npm install --production
        npm prune
        npm shrinkwrap
        npm install npm-bundle
        node ./node_modules/npm-bundle/bin/cli.js

      3. After the tarball is created, create a folder in ~/.appcelerator/install and name it the version from the package.json file i.e. the version property.
      4. Untar the tarball and move the package folder to the folder created in the above step
      5. Run appc use <VER_YOU_PREV_CREATED>
      6. Run appc new --name monkey --id com.appc.monkey --type titanium --force --no-services -l trace

      Actual: The following error will appear (also, see attached log for full stack trace):

      2017-06-20T20:30:11.611Z | ERROR  | An uncaught exception was thrown!
      "listener" argument must be a function
      2017-06-20T20:30:11.612Z | ERROR  | "listener" argument must be a function
      2017-06-20T20:30:11.613Z | TRACE  | TypeError: "listener" argument must be a function
          at _addListener (events.js:216:11)
          at Socket.addListener (events.js:276:10)
          at Socket.Readable.on (_stream_readable.js:687:35)
          at /Users/wluu/.appcelerator/install/6.2.3-master.8/package/node_modules/appc-cli-titanium/plugins/new.js:207:13
          at proceed (/Users/wluu/.appcelerator/install/6.2.3-master.8/package/node_modules/appc-cli-titanium/plugins/util.js:221:3)
          at /Users/wluu/.appcelerator/install/6.2.3-master.8/package/node_modules/appc-cli-titanium/plugins/util.js:193:3
          at /Users/wluu/.appcelerator/install/6.2.3-master.8/package/node_modules/appc-cli-titanium/plugins/util.js:88:3
          at /Users/wluu/.appcelerator/install/6.2.3-master.8/package/node_modules/appc-cli-titanium/plugins/util.js:78:3
          at ChildProcess.exithandler (child_process.js:195:7)
          at emitTwo (events.js:106:13)
          at ChildProcess.emit (events.js:191:7)
          at maybeClose (internal/child_process.js:886:16)
          at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
      2017-06-20T20:30:11.614Z | TRACE  | Sending exit signal to titanium process:  26013

      Expected: You should be able to create mobile project regardless how app-cli is built.


          Issue Links



              • Assignee:
                eharris Ewan Harris
                wluu Wilson Luu (Inactive)
              • Watchers:
                5 Start watching this issue


                • Created:

                  Git Integration