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

294
Views
Npm "scripts": "start" run express and open url

I have this start params in package.json

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

It is running my express app when I am typing npm start.

But I want browser opened http://localhost:8081 at the same time. How can I say to start to open my local url as well?

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

So when I am typing npm satrt it runs my express app and opens the url at the same time.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

As far as I know it's like writing a bash command:

// 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

For cross-platform support use open-cli.

Install it:

npm install --save-dev open-cli

Add it to your scripts:

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

0

You just need to use start in the right order!

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

Bad

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

Good

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!