Closed ttrichar closed 5 years ago
This is expected and intended behavior.
externalSchematic
executes a schematic from a different schematic collection than the currently executing schematic. The referenced schematic collection needs to exist. It does not perform any package installation; that is outside the scope of the rule.
An ng-add
schematic is also no different than any other schematic other than that it is executed by the ng add
command after the ng add
command locates and potentially installs the requested package and its dependencies (if any).
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
π Bug report
Command (mark with an
x
)Is this a regression?
No
Description
I'm trying to use externalSchematic to run an ng add for ng-momentum (https://github.com/BottleRocketStudios/ng-momentum).
This is the repository where my code currently resides: (https://github.com/lowcodeunit-devkit/ng-lcu/blob/master/src/momentum/index.ts)
I have been able to create an angular project using ng new mynewproject, and can successfully run ng add ng-momentum outside of the CLI. However, when I try to run an external schematic, I get an error that says the module "ng-momentum" can't be found. I would expect the normal behavior to add the necessary modules, like it does when ng add ng-momentum is run normally. Below is the external schematic chain:
I'm using 'scaffold', in accordance with the ng-momentum documentation. (https://github.com/BottleRocketStudios/ng-momentum/blob/master/src/collection.json)
π¬ Minimal Reproduction
1) Install our CLI (npm i @lcu/cli -g) 2) In an empty folder, run command "lcu init". Use scope = "@scope" and workspace ="workspace" 3) After the init command, run "lcu proj newProject" in the same folder. Choose "App". Choose "Momentum"
Expected behavior: The externalSchematic method will run "ng add ng-momentum", and create the app as expected
Actual behavior: App is not created, the module "ng-momentum" is unable to be found (see error below)
π₯ Exception or Error
π Your Environment