Skip to content

ng build fails w/ ERROR in ENOENT: no such file or directory, stat 'C:\C\code\##removed##\src\app\app.module.ts' #12035

Closed
@aguerot

Description

@aguerot

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node v8.9.4
npm 6.2.0

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

Angular CLI: 6.1.3
Node: 8.9.4
OS: win32 x64
Angular: 6.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.7.3
@angular-devkit/build-angular      0.7.3
@angular-devkit/build-optimizer    0.7.3
@angular-devkit/build-webpack      0.7.3
@angular-devkit/core               0.7.3
@angular-devkit/schematics         0.7.3
@angular/cdk                       6.4.1
@angular/flex-layout               6.0.0-beta.17
@angular/material                  6.4.1
@angular/material-moment-adapter   6.4.1
@ngtools/webpack                   6.1.3
@schematics/angular                0.7.3
@schematics/update                 0.7.3
rxjs                               6.2.2
typescript                         2.9.2
webpack                            4.9.2

Windows 10 (can't repro on Linux and MacOS)

Repro steps

ng build

The log given by the failure

Date: 2018-08-29T15:03:14.135Z
Hash: e414d3901afd066b8b88
Time: 13253ms
chunk {main} main.js, main.js.map (main) 1.93 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 684 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 249 kB  [rendered]
chunk {styles} styles.js, styles.js.map (styles) 566 kB [initial] [rendered]chunk {vendor} vendor.js, vendor.js.map (vendor) 325 kB [initial] [rendered]
ERROR in ENOENT: no such file or directory, stat 'C:\C\code\##removed##\src\app\app.module.ts'
i 「wdm」: Failed to compile.

Desired functionality

Build app successfully

Mention any other details that might be useful

I found weird that the path logged in the error message mentions C drive twice ->"C:\C\code"
Project was originaly created in previous version of Angular and upgraded to ng6. Issue appeared after the migration to ng6

Workaround

I managed to compile my application if I change my file \src\app\index.ts from this

export { AppModule } from './app.module';

to this

export * from './app.module';

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions