Uploaded image for project: 'Appcelerator Studio'
  1. Appcelerator Studio
  2. TISTUD-8841

Appc Studio : Use of grunt in Titanium Project failing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 5.0.0
    • Component/s: Build
    • Labels:

      Description

      Problem Description:

      Titanium project with a custom Gruntfile that gets invoked inside an alloy hook after it compiles and running it from the CLI, the hook runs fine and it finds the Gruntfile.

      But running the same project from Appcelerator studio after importing it, it does not find the Gruntfile and build fails.

      Steps to Replicate:

      1. Use the attached gruntfile-example project.
      2. Try to run it from CLI and you will see it execute the grunt task in console logs(grunt-cli should be installed in system). logs attached for CLI.
      3. Running the same project from Studio throw error message as below:

        ------------
      [TRACE] :  [0.98556s] TOTAL
      [INFO] :   
      [INFO] :   Alloy compiled in 0.98556s
      [INFO] :   grunt-cli: The grunt command line interface (v1.2.0)
      [INFO] :   
      [INFO] :   Fatal error: Unable to find local grunt.
      [INFO] :   
      [INFO] :   If you're seeing this message, grunt hasn't been installed locally to
      [INFO] :   your project. For more information about installing and configuring grunt,
      [INFO] :   please see the Getting Started guide:
      [INFO] :   
      [INFO] :   http://gruntjs.com/getting-started
      [INFO] :   
      [INFO] :   npm WARN enoent ENOENT: no such file or directory, open '/Applications/Appcelerator Studio/AppceleratorStudio.app/Contents/MacOS/package.json'
      
      

      Troubleshooting:

      While we placed the file in above path (both Gruntfile and package.json), it works fine. Indeed , when checked closely, we found that Studio tries to search in below path which we observed from console logs:

      2017-08-11T20:02:01.539Z | TRACE  | loading plugins for command "run"
      2017-08-11T20:02:01.742Z | TRACE  | run search paths:
      [
        "/Users/neeraj/.appcelerator/install/6.2.3/package",
        "/Users/neeraj/.appcelerator/install/6.2.3/package/node_modules",
        "/Applications/Appcelerator Studio/AppceleratorStudio.app/Contents/MacOS/node_modules",
        "/Applications/Appcelerator Studio/AppceleratorStudio.app/Contents/node_modules",
        "/Applications/Appcelerator Studio/AppceleratorStudio.app/node_modules",
        "/Applications/Appcelerator Studio/node_modules",
        "/Applications/node_modules",
        "/node_modules",
        "/Users/neeraj/.appcelerator/.npm/lib/node_modules"
      ]
      

      Placing files(Gruntfile and package.json) in any of the above directory works fine. While in CLI, we keep these file in root directory of project and it works fine.

      Expected Result: Studio should be able to locate these files from project's root directory.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cwilliams Christopher Williams
                Reporter:
                nmishra Neeraj Mishra
                Reviewer:
                Kondal Kolipaka (Inactive)
              • Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: