question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migrating a Yarn workspace from a traditional Angular CLI workspace to an Nx fails

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
chihabcommented, Nov 21, 2020

As a workaround you can create a .yarnrc file in your root yarn workspace and set the flag to --ignore-workspace-root-check to true

.yarnrc –ignore-workspace-root-check true

1reaction
philipjfulchercommented, Jan 22, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found