Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25996] CLI: build process does not lookup modules the same way as ti module

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 7.0.2, Release 7.1.1
Fix Version/sn/a
ComponentsCLI
Labelscb-tooling, config, engSchedule, modules
ReporterCreative
AssigneeUnknown
Created2018-04-30T12:42:49.000+0000
Updated2020-01-30T22:00:13.000+0000

Description

When i set a custom module path using *appc ti config paths.modules "mycustom/path"*, the modules I put in here are not recognized in the build command. I checked using the *appc ti module* command, and my module is listed under *Configured Path Modules*, and not under *Global Modules* (which is correct). However, the one under Configured Path Modules points to the correct path but it is not recognized during build, and therefore it throws:
[ERROR] Could not find all required Titanium Modules:
[ERROR]    id: com.mymodule	 version: 1.1.0	 platform: iphone	 deploy-type: development
The desired situation checks both the default directory (the global one under "~/Library/Application Support/Titanium/modules"), but also the custom directory added using the config file.

Comments

  1. Ewan Harris 2018-05-01

    This is a valid bug and looks to be due to a discrepancy in the lookup functions used in each case (ti module vs ti build). ti module, calls [scopedDetect](https://github.com/appcelerator/node-appc/blob/d42127a142569be3201cab1530beef06dac021f3/lib/timodule.js#L47-L78) which assumes that the paths given to it are valid paths to a modules directory (e.g /Users/eharris/Library/Application\ Support/Titanium/modules) this then just scans the directory as normal and therefore detects all modules. ti build, calls (eventually) [detect](https://github.com/appcelerator/node-appc/blob/d42127a142569be3201cab1530beef06dac021f3/lib/timodule.js#L93-L184) which assumes that the paths given to it are valid paths to the parent of a modules directory (e.g /Users/eharris/Library/Application\ Support/Titanium), during the detection it will then construct the modules path to search ( /Users/eharris/Library/Application\ Support/Titanium/modules), if you've already given it the full path ( /Users/eharris/Library/Application\ Support/Titanium/modules) then you get an invalid path ( /Users/eharris/Library/Application\ Support/Titanium/modules/modules). The easy workaround for now is to include both paths in the paths.modules array, you can add them in one go by just including them in the same command ti config paths.modules /Users/eharris/Desktop/ /Users/eharris/Desktop/modules. [~uzbbert] could you maybe try that and see if it works for you? Edit: There is actually a specific order you have to enter them it, I had it in the wrong order previously the parent directory (the one without /modules) *_+must be passed first+_* and show in the first position of the paths.modules array, then the child directory second
  2. Creative 2018-05-01

    yes thank you, the workaround works. Only inconvenience now is that I had to change my custom directory to *modules* locally, because it is actually a git repository that is named differently on the remote. But it'll do for now, thanks for the quick investigation.

JSON Source