Skip to content

Angular CLI doesn't work well with Yarn workspaces #12288

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

Closed
njirem opened this issue Sep 17, 2018 · 2 comments
Closed

Angular CLI doesn't work well with Yarn workspaces #12288

njirem opened this issue Sep 17, 2018 · 2 comments

Comments

@njirem
Copy link

njirem commented Sep 17, 2018

Bug Report or Feature Request

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

Command

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

Versions

Angular CLI: 7.0.0-beta.3
Node: 10.10.0
OS: darwin x64
Angular: 7.0.0-beta.5

But it also occurs in the current version of Angular CLI (6.2.2).

Repro steps

  • Set up a project with Yarn Workspaces.
  • Use the Angular CLI to create a new project
  • Remove the node_modules inside the newly created folder and run yarn to make sure the packages are hoisted
  • Run ng build or ng serve

The log given by the failure

The error: 'You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.'

Desired functionality

It would be great if rxjs and @angular can be hoisted to a parent of the angular project root.

The current workaround is to add these packages to 'nohoist' in the workspace package.json. In our case this results in two instances of rxjs in the client, but the current rxjs version should be able to handle this.

Mention any other details that might be useful

This issue is also discussed in: #3864 (closed).

It seems this line is the main problem.

I don't know why it is added though. It was added in commit 44086c6. The commit says it's a 'move', but this move of packages/@angular/cli/upgrade/version.ts to packages/angular/cli/upgrade/version.ts also has a change in the code in it.

@njirem njirem changed the title Regression: Angular CLI doesn't work well with Yarn workspaces Angular CLI doesn't work well with Yarn workspaces Sep 17, 2018
@alan-agius4
Copy link
Collaborator

Duplicate of #11685

@alan-agius4 alan-agius4 marked this as a duplicate of #11685 Sep 17, 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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants