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

1K
Visualizações
Executing "ng serve" or "npm start" command browser is not opening automatically

I have generated a project using angular-cli by following steps given in installation section. Project is running right now. But i have to open browser manually by typing http://localhost:4200/ into browser.

Could it be possible like when user will execute "ng serve" or "npm start" command, browser will open automatically?

Please let me know if it is possible or give me any solution for this.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Per the documentation you can use a flag with ng serve:

--open (-o) Opens the url in default browser.

You may need update your version for this functionality, as the revision history of the wiki page suggests it's a recent addition.

over 4 years ago · Santiago Trujillo Relatório

0

One developer of theangular-cli team said on Jun 17, 2016;

We don't have this functionality at the moment, no. But I'll leave the issue open as a 'nice to have'.

but

You could just change what npm start does in the package.json.

E.g. change

"start": "ng serve"

to

"start": "start http://localhost:4201 & ng serve -port 4201"
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