Creating a module deeper than src/app throws Invalid path
Please provide us with the following information:
OS?
Mac OSX El Capitan 10.11.4
Versions.
angular-cli: 1.0.0-beta.21 node: 6.7.0 os: darwin x64
Repro steps.
- Create new project with ng new my-app
- Create a new folder inside src/app (e.g. src/app/modules)
- Go to new folder (cd src/app/modules)
- Create new module (ng g module core)
The log given by the failure.
Invalid path: "
Mention any other details that might be useful.
To summarise this issue. While creating a new module the cli tries to go into the same folder again, if the module is created deeper than /src/app. Creating an module inside /src/app works as expected.
Thanks! We'll be in touch soon.
I get this too, even with v 22-1
I got this 22-1 today as well, same conditions (except macOS Sierra 10.12.2):
- Created Dashboard module: ng g module dashboard --routing true
- Changed directory into dashboard: cd dashboard
- Attempted to create nested module: ng g module ./my-projects --routing true
I received: Invalid path: ".....app/dashboard/dashboard"" is not a valid path.
I have not been able to reproduce this issue. Can someone who was experiencing this please retry with the latest version of the CLI?
@Brocco just tested with .beta-24. ng g module module-name doesn't throw this error anymore. Though, using ng g module module-name --routing does throw the error. This means the error occurs during component creation I guess.
I had the same issue on beta22-1 so I updated cli to 24. Now, the error's gone and the difference from the previous is that ng g module "name" command only generates module. Can you please update Readme on generating module with added options? It confuses the old users when generating the modules.
Update: As @SebastianSchenk mentioned, --routing flag also throws error for me. Even in beta22-1, the error occurred on component creation. The error says /src/app/dashboard/dashboard is not a valid path but I'm trying to generate in /src/app/dashboard.
The current behavior for generating modules is to only generate a component when the --routing argument is used. That's why you only get the module.
Added in https://github.com/angular/angular-cli/pull/3389
I'm working on the issue with component, not changing the routing behavior though.
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.