Typescript express nodejs server build issue

I’ve got a node express app written in typescript. Build is failing in Render during deploying the web service. In my local system build is successful and server is up and functioning.

package.json: {
“name”: “backend1”,
“version”: “1.0.0”,
“main”: “index.js”,
“scripts”: {
“build”: “npm install && tsc”,
“start”: “node dist/index.js”,
“test”: “echo "Error: no test specified" && exit 1”
},
“author”: “”,
“license”: “ISC”,
“keywords”: ,
“description”: “”,
“dependencies”: {
“express”: “^4.21.2”,
“typescript”: “^5.8.3”,
“@types/node”: “^22.10.6”,
“@types/express”: “^5.0.0”,
“@types/ws”: “^8.5.13”,
…}

tsconfig.json: {
“outDir”: “./dist” /* Specify an output folder for all emitted files. */,
“rootDir”: “./src”,
…}
Build command ‘npm install && npm run build’
Build has failed. Logs: ==> Checking out commit a8c89339226fd36fe243dba8c6a35b67c5812ffb in branch main

May 18 04:36:30 PM

==> Using Node.js version 22.14.0 (default)

May 18 04:36:30 PM

==> Docs on specifying a Node.js version: Setting Your Node.js Version – Render Docs

May 18 04:36:32 PM

==> Using Bun version 1.1.0 (default)

May 18 04:36:32 PM

==> Docs on specifying a bun version: Setting your Bun Version – Render Docs

May 18 04:36:32 PM

==> Running build command ‘npm install && npm run build’…

May 18 04:36:41 PM

May 18 04:36:41 PM

added 324 packages, and audited 817 packages in 8s

May 18 04:36:41 PM

May 18 04:36:41 PM

69 packages are looking for funding

May 18 04:36:41 PM

run npm fund for details

May 18 04:36:41 PM

May 18 04:36:41 PM

59 vulnerabilities (1 low, 17 moderate, 33 high, 8 critical)

May 18 04:36:41 PM

May 18 04:36:41 PM

To address issues that do not require attention, run:

May 18 04:36:41 PM

npm audit fix

May 18 04:36:41 PM

May 18 04:36:41 PM

To address all issues (including breaking changes), run:

May 18 04:36:41 PM

npm audit fix --force

May 18 04:36:41 PM

May 18 04:36:41 PM

Run npm audit for details.

May 18 04:36:41 PM

May 18 04:36:41 PM

backend1@1.0.0 build

May 18 04:36:41 PM

npm install && tsc

May 18 04:36:41 PM

May 18 04:36:43 PM

May 18 04:36:43 PM

up to date, audited 817 packages in 2s

May 18 04:36:43 PM

May 18 04:36:43 PM

69 packages are looking for funding

May 18 04:36:43 PM

run npm fund for details

May 18 04:36:43 PM

May 18 04:36:43 PM

59 vulnerabilities (1 low, 17 moderate, 33 high, 8 critical)

May 18 04:36:43 PM

May 18 04:36:43 PM

To address issues that do not require attention, run:

May 18 04:36:43 PM

npm audit fix

May 18 04:36:43 PM

May 18 04:36:43 PM

To address all issues (including breaking changes), run:

May 18 04:36:43 PM

npm audit fix --force

May 18 04:36:43 PM

May 18 04:36:43 PM

Run npm audit for details.

May 18 04:36:43 PM

May 18 04:36:43 PM

May 18 04:36:43 PM

This is not the tsc command you are looking for

May 18 04:36:43 PM

May 18 04:36:43 PM

May 18 04:36:43 PM

To get access to the TypeScript compiler, tsc, from the command line either:

May 18 04:36:43 PM

May 18 04:36:43 PM

  • Use npm install typescript to first add TypeScript to your project before using npx

May 18 04:36:43 PM

  • Use yarn to avoid accidentally running code from un-installed packages

May 18 04:36:43 PM

==> Build failed :disappointed_face:

Basically npm install is not installing typescript. How do I resolve the issue?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.