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

NodePackageInstallTask not triggered after app generation #12719

Closed
klemenoslaj opened this issue Oct 23, 2018 · 4 comments · Fixed by #12730
Closed

NodePackageInstallTask not triggered after app generation #12719

klemenoslaj opened this issue Oct 23, 2018 · 4 comments · Fixed by #12730
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@klemenoslaj
Copy link

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node: v8.12.0
npm: 6.4.1
yarn: 1.10.1

Angular CLI:
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@angular/cli 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3

Repro steps

Execute the following commands in the exact order:

  • ng new foo --create-application false --routing false --style css
  • cd foo
  • ng g app playground
    • notice here that package.json was updated but package manager was not triggered
  • ng serve - Failure

Simply running package manager of choice after will resolve the issue.

The log given by the failure

After ng serve is triggered Angular CLI correctly reports the following error:
Could not find module "@angular-devkit/build-angular" from "/Relative/path/to/workspace".

Desired functionality

The same as with library schematic, NodePackageInstallTask should be executed as the last task.
Probably --skip-install flag in the schema would equally make sense.

@alan-agius4
Copy link
Collaborator

Are you experiencing any errors when running ng new? As I am unable to replicate this issue.

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Oct 24, 2018
@klemenoslaj
Copy link
Author

@alan-agius4, no the problem is not with ng new. Sorry for the misunderstanding. Basically, my observation is related to ng g app command.


When a workspace with --create-application false flag is created, the initial application in src folder is not being generated, nor the related dependencies added to package.json.

Generating an app right after that will result with the app in the projects and with the new dev dependency @angular-devkit/build-angular added to package.json.

That's all fine, however, since package manager was not triggered @angular-devkit/build-angular is not installed yet, so executing ng serve now will result in an error.

I was thinking that a package manager has to be triggered after the app generation the same way as it is when generating a library (as well --skip-install flag is available in the library schematic).

@alan-agius4
Copy link
Collaborator

Thanks, for the explanation. I now see the problem.

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: schematics/angular and removed needs: more info Reporter must clarify the issue labels Oct 24, 2018
@ngbot ngbot bot added this to the needsTriage milestone Oct 24, 2018
@ngbot ngbot bot modified the milestone: needsTriage Oct 24, 2018
@ngbot ngbot bot added this to the Backlog milestone Oct 24, 2018
@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants