1
resposta

Erro ao executar ng --serve open

Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at levenshtein (C:\Users\Lucas\Desktop\alurapic\node_modules\@angular\cli\models\command-runner.js:58:23)
    at listAllCommandNames.sort (C:\Users\Lucas\Desktop\alurapic\node_modules\@angular\cli\models\command-runner.js:69:43)
    at Array.sort (native)
    at Object.<anonymous> (C:\Users\Lucas\Desktop\alurapic\node_modules\@angular\cli\models\command-runner.js:67:65)
    at Generator.next (<anonymous>)
    at C:\Users\Lucas\Desktop\alurapic\node_modules\@angular\cli\models\command-runner.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\Lucas\Desktop\alurapic\node_modules\@angular\cli\models\command-runner.js:3:12)
    at Object.runCommand (C:\Users\Lucas\Desktop\alurapic\node_modules\@angular\cli\models\command-runner.js:28:12)
    at C:\Users\Lucas\Desktop\alurapic\node_modules\@angular\cli\lib\cli\index.js:60:58

sempre que tento executar o comando, aparece esse erro.

1 resposta

Meu erro tá diferente...

$ ng serve --open

chunk {main} main.js, main.js.map (main) 57.8 kB [initial] [rendered] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 140 kB [initial] [rendered] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered] chunk {styles} styles.js, styles.js.map (styles) 9.71 kB [initial] [rendered] chunk {vendor} vendor.js, vendor.js.map (vendor) 2.68 MB [initial] [rendered] Date: 2020-02-20T16:16:19.904Z - Hash: b4949cc6c9a12b278e9b - Time: 9013ms ** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** : Compiled successfully.

E aparece o browser uma tela em branco!

Seguem minhas versões

node -v v13.6.0 npm --version 6.13.7 ng --version Angular CLI: 9.0.3 Node: 13.6.0 OS: linux x64

    Angular: 
    ... 
    Ivy Workspace: 

    Package                      Version
    ------------------------------------------------------
    @angular-devkit/architect    0.900.3
    @angular-devkit/core         9.0.3
    @angular-devkit/schematics   9.0.3
    @schematics/angular          9.0.3
    @schematics/update           0.900.3
    rxjs                         6.5.3