Open Closed

ABP CLI / install-libs forces Yarn Classic 1.x — creates a fragile two-version Yarn setup for Angular projects on Yarn Berry #10886


User avatar
0
ageiter created

We're running ABP Framework 10.4 with an Angular 21 frontend. Our angular/ project uses Yarn Berry 4.12.0 (nodeLinker: node-modules in .yarnrc.yml), not Yarn Classic — this is required for our dependency setup (private npm registry scopes for FontAwesome Pro, etc.).

The problem: abp install-libs appears to only support/detect Yarn Classic 1.x, so our local setup script has to explicitly switch Yarn versions back and forth via Corepack around it:

corepack prepare yarn@1.22.22 --activate
abp install-libs

corepack prepare yarn@4.12.0 --activate
yarn install

This is fragile in practice: abp install-libs internally runs an unfrozen yarn install under whichever Yarn version is currently active. When it runs under Yarn 1, it silently rewrites yarn.lock back into the old v1 lockfile format. If the script is ever interrupted, or someone runs abp install-libs in isolation without the follow-up corepack prepare yarn@4.x --activate && yarn install, the repository can end up with a Yarn-1-format lockfile committed on top of a Yarn-Berry project — completely silently, since a plain local yarn install doesn't complain about it. This happened to us once and was hard to trace back.

Questions:

  • Is there a supported way to make abp install-libs work with an already-active Yarn Berry installation, instead of requiring Yarn 1 specifically?
  • Since the docs state install-libs is meant for MVC/Razor Pages/Blazor Server only — is it actually required at all for an Angular project, or is calling it in our setup script simply unnecessary legacy boilerplate we can drop?

Any clarification would help us remove this two-Yarn-version workaround entirely.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • There is no supported way (in ABP 10.4.x) to make abp install-libs work with Yarn Berry. ABP’s guidance for its frontend tooling is to use Yarn Classic (v1.22+) (not v2+), so the CLI behavior you’re seeing is consistent with the supported tooling expectations.
    • For an Angular UI solution, abp install-libs is not required (and in your case, it’s actively harmful because it can rewrite yarn.lock to v1 format). You can remove it from your setup script. The install-libs command is for installing/copying web (JS/CSS) libraries into wwwroot/libs for MVC/Razor Pages/Blazor Server style UIs; Angular manages its dependencies via its own package manager workflow (yarn install, yarn start/build) and does not need that wwwroot/libs step.

    Practical recommendation for your repo:

    1. Delete abp install-libs from your onboarding/build scripts for the Angular project.
    2. Keep your Yarn Berry/Corepack workflow only:
    corepack prepare yarn@4.12.0 --activate
       yarn install
    
    1. (Optional hardening) Add a CI check to fail if yarn.lock is rewritten to a v1 header format, to prevent silent regressions.

    Source (ABP prerequisite explicitly recommending Yarn Classic, not v2+):

    • https://abp.io/docs/latest/get-started/pre-requirements

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.