Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1540

npm node_modules are erroring when compiling


    • Type: Bug
    • Status: Reopened
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: alloy 1.9.11
    • Component/s: Tooling
    • Labels:
    • Environment:

      Any (Tested on 6.0.1.GA)

    • Story Points:
    • Sprint:
      2017 Sprint 07 Tooling


      I believe it was said that Ti SDK 6.0.0+ came with full node support. This should include installation of npm modules as well. Sadly, a lot of modules are not passing the compilation process of titanium, because they do not follow a certain convention.

      One of those error messages would be:

      [ERROR] Error generating AST for "/Users/john/Documents/Appcelerator_Studio_Workspace/myapp/Resources/iphone/node_modules/glob/test/00-setup.js"
      [ERROR] 'return' outside of function
      [ERROR] line 82, position 1779
      [ERROR] Alloy compiler failed


      Create a package.json (regular npm setup) inside app/lib so the packages come available during runtime. Install for instance `mocha` (https://www.npmjs.com/package/mocha). There are many more packages that will fail the compilation process once installed into /app.


        "name": "myapp",
        "description": "myapp",
        "private": true,
        "dependencies": {
        "devDependencies": {
          "mocha": "2.5.3",
          "should": "7.1.1",
          "ti-mocha": "0.2.0"

      run `npm install` in this directory to install the module.

      I recommend installing a lot of packages, and determine if they pass the Alloy compiler. Every compilation should pass.


          Issue Links



              • Assignee:
                fmiao Feon Sua Xin Miao
                creative_jira_user Creative (Inactive)
              • Watchers:
                8 Start watching this issue


                • Created:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration