Migrating a Yarn workspace from a traditional Angular CLI workspace to an Nx fails
See original GitHub issueCurrent Behavior
When trying to migrate a Yarn workspace from a traditional Angular CLI workspace to an Nx workspace, it fails with the following error:
Installing packages for tooling via yarn.
An unhandled exception occurred: error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
Package install failed, see above.
See "/private/var/folders/5s/2g7_c5f120d9t9f280skfw2c0000gn/T/ng-xfBnhp/angular-errors.log" for further details
Expected Behavior
I expect to be able to migrate my traditional Angular CLI workspace to Nx even if I am using Yarn workspaces.
Steps to Reproduce
Generate a new Angular CLI workspace
ng new my-app --defaults --package-manager=yarn
Make it a Yarn workspace
Add "workspaces": []
to the package.json
file.
Try migrating to an Nx workspace
ng add @nrwl/workspace
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Migrating an Angular CLI project to Nx
This command will install the correct version of Nx based on your Angular version. This will enable you to use the Nx CLI...
Read more >Migration | Yarn - Package Manager
A step-by-step and in-depth migration guide from Yarn 1 (Classic) to Yarn 2 (Berry).
Read more >A guide through The Wild Wild West of setting up a mono repo ...
A guide through The Wild Wild West of setting up a mono repo with TypeScript, Lerna and Yarn Workspaces. This is were the...
Read more >nrwl-nx/community - Gitter
Hi, I'm trying to run affected:test but I'm getting errors: NX ERROR Running target "test" for affected projects failed . There is list...
Read more >The Case for Monorepos: A sane Workspace Setup (Part 2)
Learn how to setup dev tooling in a monorepo, run tasks efficiently, release multiple packages and overcome common DevOps challenges.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As a workaround you can create a
.yarnrc
file in your root yarn workspace and set the flag to--ignore-workspace-root-check
totrue
.yarnrc –ignore-workspace-root-check true
@chihab thanks for your contribution! The .yarnrc looks like the best bet for managing this issue. I’ll close this bug, anyone with a similar issue should use the .yarnrc solution above.