Skip to content

ng build fails when using an absolute path in --output-path #26935

Closed

Description

@paulflo150

Command

build

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

<17

Description

Using an absolute path with ng build in --output-path throws an error, the build command appears to append the source folder to the folder provided in the --output-path. Using a relative path on the other hand works.

Minimal Reproduction

ng build --configuration production --output-path="D:\builds\myapp"

Exception or Error

An unhandled exception occurred: ENOENT: no such file or directory, mkdir 'D:\Source.App\D:\builds\myapp\browser'

Your Environment

Angular CLI: 17.1.0
Node: 20.9.0
Package Manager: npm 10.1.0
OS: win32 x64

Angular: 17.0.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.5
@angular-devkit/build-angular   17.0.5
@angular-devkit/core            17.0.5
@angular-devkit/schematics      17.1.0
@angular/cdk                    17.0.1
@angular/cli                    17.1.0
@angular/fire                   17.0.0
@angular/material               17.0.1
@schematics/angular             17.1.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else relevant?

No response

Activity

  1. clydin commented on Jan 23, 2024

    @clydin
    Member

    Duplicate of #26900

  2. paulflo150 commented on Jan 26, 2024

    @paulflo150
    Author

    @clydin, this does not appear to be the same issue because I am using 17.1.1 and the problem persists.

    `Angular CLI: 17.1.1
    Node: 20.9.0
    Package Manager: npm 10.1.0
    OS: win32 x64

    Angular: 17.1.1
    ... animations, cli, common, compiler, compiler-cli, core, forms
    ... platform-browser, platform-browser-dynamic, router

    Package Version

    @angular-devkit/architect 0.1701.1
    @angular-devkit/build-angular 17.1.1
    @angular-devkit/core 17.1.1
    @angular-devkit/schematics 17.1.1
    @angular/cdk 17.1.0
    @angular/fire 17.0.1
    @angular/material 17.1.0
    @schematics/angular 17.1.1
    rxjs 7.8.1
    typescript 5.2.2
    zone.js 0.14.2

    ng build --configuration production --output-path="D:\builds\app"`

    An unhandled exception occurred: ENOENT: no such file or directory, mkdir 'D:\_Source.APP\D:\builds\app\browser'

  3. added 2 commits that reference this issue on Jan 26, 2024
    ce74a16
    d8b5575
  4. added 2 commits that reference this issue on Jan 26, 2024
    37ffa5e
    5332e5b
  5. angular-automatic-lock-bot commented on Feb 26, 2024

    @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 Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions