Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a module deeper than src/app throws Invalid path #3255

Closed
SebastianSchenk opened this issue Nov 23, 2016 · 7 comments · Fixed by #3916
Closed

Creating a module deeper than src/app throws Invalid path #3255

SebastianSchenk opened this issue Nov 23, 2016 · 7 comments · Fixed by #3916
Assignees
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@SebastianSchenk
Copy link

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: "/src/app/modules/modules"" is not a valid 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.

@elvisbegovic
Copy link
Contributor

elvisbegovic commented Dec 16, 2016

I get this too, even with v 22-1

@panicst8
Copy link

panicst8 commented Dec 18, 2016

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.

@filipesilva filipesilva added command: generate P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix labels Dec 29, 2016
@Brocco
Copy link
Contributor

Brocco commented Dec 30, 2016

I have not been able to reproduce this issue. Can someone who was experiencing this please retry with the latest version of the CLI?

@SebastianSchenk
Copy link
Author

@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.

@thisisgit
Copy link

thisisgit commented Jan 6, 2017

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.

@Meligy
Copy link
Contributor

Meligy commented Jan 9, 2017

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 #3389

I'm working on the issue with component, not changing the routing behavior though.

Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 9, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 9, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 9, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 9, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 10, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 11, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 12, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 12, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Meligy added a commit to Meligy/angular-cli that referenced this issue Jan 15, 2017
…folder, and parent folder is not a module too

fixes angular#3255
Brocco pushed a commit that referenced this issue Jan 16, 2017
…folder, and parent folder is not a module too (#3916)

fixes #3255
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
7 participants