Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
Npm "scripts": "iniciar" ejecutar express y abrir url

Tengo estos parámetros de inicio en package.json

 "scripts": { "start": "node bin/www" },

Está ejecutando mi aplicación Express cuando escribo npm start .

Pero quiero que el navegador abra http://localhost:8081 al mismo tiempo. ¿Cómo puedo decir que start a abrir mi URL local también?

como: "start": "node bin/www, http://localhost:8081"

Entonces, cuando escribo npm satrt , ejecuta mi aplicación Express y abre la URL al mismo tiempo.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Por lo que sé, es como escribir un comando bash:

 // Windows "start":"start http://localhost:8081 & node bin/www" // Mac "start":"open http://localhost:8081 && node bin/www" // Linux "start":"xdg-open http://localhost:8081 && node bin/www"
over 4 years ago · Santiago Trujillo Report

0

Para soporte multiplataforma, use open-cli .

Instalarlo:

 npm install --save-dev open-cli

Agrégalo a tus scripts:

 "start": "open-cli http://localhost:8081 && node bin/www"
over 4 years ago · Santiago Trujillo Report

0

¡Solo necesita usar start en el orden correcto!

 "start": "npm run dev & start http://localhost:8000",

Malo

 "start": "start http://localhost:8000 & npm run dev",

Bueno

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!