Skip to content

Angular CLI v20 creates project without less dependency #30503

Closed

Description

@jgosar

Command

new

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

19.2.14

Description

I upgraded Angular CLI to v20.0.1 and then tried to create a new Angular v20 application using LESS stylesheets.

After the node modules were installed, I tried to launch the app using ng serve without doing any modifications to the code.

I got the error Unable to load the "less" stylesheet preprocessor. [plugin angular-less].

I was able to resolve the issue by adding this to the devDependencies in package.json:

    "less": "^4.2.0",

But this should have been added by the CLI already.

Minimal Reproduction

ng new angular-demo-app
✔ Do you want to create a 'zoneless' application without zone.js (Developer Preview)? Yes
✔ Which stylesheet format would you like to use? Less [ http://lesscss.org ]
✔ Do you want to enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering)? No
cd angular-demo-app
ng serve

Exception or Error

Application bundle generation failed. [1.277 seconds]

✘ [ERROR] Unable to load the "less" stylesheet preprocessor. [plugin angular-less]

    angular:styles/global:styles:1:8:
      1 │ @import 'src/styles.less';
        ╵         ~~~~~~~~~~~~~~~~~

  Ensure that the "less" Node.js package is installed within the project. If not present, installation via the project's package manager should resolve the error.

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 20.0.1
Node: 22.12.0
Package Manager: npm 10.9.0
OS: linux x64

Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2000.1 (cli-only)
@angular-devkit/core         20.0.1 (cli-only)
@angular-devkit/schematics   20.0.1 (cli-only)
@schematics/angular          20.0.1 (cli-only)

Anything else relevant?

No response

Activity

  1. added
    freq1: low
    on Jun 10, 2025
  2. added theissue type on Jun 10, 2025
  3. added 4 commits that reference this issue on Jun 10, 2025
    0d236e6
    116ebbf
    4a72a0f
    f9a9f8b
  4. added 2 commits that reference this issue on Jun 10, 2025
    42f45a3
    bf64a0f
  5. angular-automatic-lock-bot commented on Jul 11, 2025

    @angular-automatic-lock-bot

    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.

  6. locked and limited conversation to collaborators on Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @schematics/angularfreq1: lowseverity5: regressiontype: bug/fix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions