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

195
Views
How to make a production ready node.js server run when built?

I have created a node.js server and everything works in dev. I even have a docker instance and when building it it all works.

I wondered how could I make a minimized build for production but so far I have not been able to figure it out.

My package.json:

{
  "name": "rugbe",
  "version": "1.0.0",
  "description": "",
  "main": "index.ts",
  "scripts": {
    "build": "tsc -p .",
    "dev": "npx ts-node-dev --prefer-ts true --no-notify -r tsconfig-paths/register --watch src --transpile-only index.ts"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.19.1",
    "express": "^4.17.2",
    "helmet": "^5.0.2"
  },
  "devDependencies": {
    "@types/express": "^4.17.13",
    "@types/node": "^16.11.22",
    "nodemon": "^2.0.15",
    "ts-node": "^10.4.0",
    "ts-node-dev": "^1.1.8",
    "tsconfig-paths": "^3.12.0",
    "ttypescript": "^1.5.13",
    "typescript": "^4.5.5",
    "typescript-transform-paths": "^3.3.1"
  }
}

When I run npm run bild I get:

rugbe@1.0.0 build

tsc -p .

But nothing starts?

when I run the npm run dev I get.

rugbe@1.0.0 dev

npx ts-node-dev --prefer-ts true --no-notify -r tsconfig-paths/register --watch src --transpile-only index.ts

[INFO] 23:27:01 ts-node-dev ver. 1.1.8 (using ts-node ver. 9.1.1, typescript ver. 4.5.5)

App running on port 5000

index.ts:

import App from "./src/app";

App.listen(5000);

console.log("App running on port 5000");

Overal project structure

enter image description here

What is the correct script here?

about 4 years ago · Juan Pablo Isaza
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!