Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

445
Visualizações
ERROR en TypeError: no se puede leer la propiedad 'flags' de indefinido

Tengo un problema cuando intento ejecutar ng serve en un proyecto Angular creado recientemente. La versión que estoy usando es 9.1.4, este error no ocurre en un proyecto con una versión anterior de Angular.

 Package Version ----------------------------------------------------------- @angular-devkit/architect 0.901.4 @angular-devkit/build-angular 0.901.4 @angular-devkit/build-optimizer 0.901.4 @angular-devkit/build-webpack 0.901.4 @angular-devkit/core 9.1.4 @angular-devkit/schematics 9.1.4 @angular/cli 9.1.4 @ngtools/webpack 9.1.4 @schematics/angular 9.1.4 @schematics/update 0.901.4 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0

Después de ejecutar ng serve o ng build :

 chunk {main} main.js, main.js.map (main) 2 kB [initial] [rendered]<br> chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 679 bytes [initial] [rendered]<br> chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]<br> chunk {styles} styles.js, styles.js.map (styles) 12.4 kB [initial] [rendered]<br> chunk {vendor} vendor.js, vendor.js.map (vendor) 339 kB [initial] [rendered]<br> Date: 2020-05-08T02:06:46.145Z - Hash: 1a1b937f0ca2bb37634b - Time: 4087ms<br> **ERROR in TypeError: Cannot read property 'flags' of undefined** at resolveAlias (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:36513:37) at checkAliasSymbol (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64502:26) at checkImportBinding (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64534:13) at checkImportDeclaration (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64552:29) at checkSourceElementWorker (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64961:28) at checkSourceElement (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:64800:17) at Object.forEach (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:317:30) at checkSourceFileWorker (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65123:20) at checkSourceFile (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65091:13) at getDiagnosticsWorker (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65179:17) at Object.getDiagnostics (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:65165:24) at C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98703:85 at runWithCancellationToken (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98665:24) at getBindAndCheckDiagnosticsForFileNoCache (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98691:20) at getAndCacheDiagnostics (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98956:26) at getBindAndCheckDiagnosticsForFile (C:\Cursos\Angular\ang-hello-world\node_modules\typescript\lib\typescript.js:98688:20) ** **Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/** **

El resultado que obtengo en mi navegador después de ejecutar este proyecto es:

 Cannot GET /
over 4 years ago · Santiago Trujillo
5 Respostas
Responde à pergunta

0

prueba esta solución:

 npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4 npm install ng serve
over 4 years ago · Santiago Trujillo Relatório

0

editar

Si usa angular 9.1.6, debería estar bien ahora

 npm update @angular/cli @angular/core

publicación original

Algo está roto en Angular 9.1.5: si ejecuta lo siguiente, debería funcionar:

 npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4 ng build

Acabo de pasar alrededor de 4-5 horas tratando de arreglarlo yo mismo...

El problema parece provenir del uso de Angular CLI 9.1.4 con Angular 9.1.5 (lo más probable es que el compilador

Verás el problema cuando lo hagas.

 ng --version

Si lo consigues:

 Angular CLI: 9.1.4 Node: 12.16.3 OS: win32 x64 Angular: 9.1.5 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Ivy Workspace: Yes

Luego, deberá seguir las instalaciones de npm que enumeré anteriormente

over 4 years ago · Santiago Trujillo Relatório

0

La respuesta de @Matt también funcionó para mí para ng serve , pero necesitaba pasos adicionales. Primero haga estos pasos "Citando los pasos de su respuesta":

  1. Primero verifique ng --version . Vaya al siguiente paso si obtiene:
 Angular CLI: 9.1.4 Node: 12.16.3 OS: win32 x64 Angular: 9.1.5 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router Ivy Workspace: Yes
  1. Fuerce la reinstalación de los paquetes angulares con 9.1.4 como versión usando:
 npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4

Un par de pasos más para que más ng serve para finalmente funcionar.

  1. El siguiente error que recibí fue sobre tslib: se An unhandled exception occurred: Cannot find module 'tslib' Para esto, instalé el paquete tslib manualmente usando npm.
  2. El siguiente error que recibí fue You seem to not be depending on "@angular/core" and/or "rxjs". This is an error. . Para esto me refería "Parece que no dependes de" @ angular / core ". ¡y voilá! ng servir funcionó!
over 4 years ago · Santiago Trujillo Relatório

0

9.1.6 recién lanzado, debería solucionar ese problema

over 4 years ago · Santiago Trujillo Relatório

0

Tengo el mismo problema al actualizar de 10.1.0 a 11.1.1.

Actualizar TypeScript a la última versión de 4.0.2 a 4.1.3 resolvió el problema:

npm i typescript@latest

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda