Skip to content

ng update _resolveFilename error on Windows with CLI 12.0.3 #21027

Closed
@simeyla

Description

@simeyla

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes

Description

I updated @angular/core earlier today on Windows to 12.0.3 and just noticed a second update to CLI for the corresponding version.

However, when running ng update I get this error:

image

This is clearly some kind of filename concatanation issue that is affecting Windows paths.

🔬 Minimal Reproduction

Just run ng update. The project in question is just a stub application generated with ng new from 12.0.2.

I deleted node_modules and reinstalled just to be sure.

🔥 Exception or Error


PS C:\temp\angular12\angular12> ng update
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
√ Package successfully installed.
internal/modules/cjs/loader.js:984
  throw err;
  ^

Error: Cannot find module 'C:\temp\angular12\angular12\'C:\Users\SimonWeaver\AppData\Local\Temp\angular-cli-packages-nLDj0k\node_modules\@angular\cli\bin\ng''
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
    at Function.Module._load (internal/modules/cjs/loader.js:863:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
PS C:\temp\angular12\angular12>

🌍 Your Environment


Angular CLI: 12.0.2
Node: 12.16.0
Package Manager: npm 6.10.3
OS: win32 x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.2
@angular-devkit/build-angular   12.0.2
@angular-devkit/core            12.0.2
@angular-devkit/schematics      12.0.2
@schematics/angular             12.0.2
rxjs                            6.6.7
typescript                      4.2.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions