TypeScripts tsc is not found on build on render.com webservice

I am getting the following error on build. All works well locally:

$ tsc && tsc-alias
 /bin/sh: 1: tsc: not found

My package.json looks like this:

{
  "devDependencies": {
    "@types/cors": "^2.8.13",
    "@types/express": "^4.17.17",
    "@types/node": "^20.3.1",
    "@types/swagger-jsdoc": "^6.0.1",
    "@types/swagger-ui-express": "^4.1.3",
    "@types/yamljs": "^0.2.31",
    "nodemon": "^2.0.22",
    "tsc-alias": "^1.8.7",
    "tsconfig-paths": "^4.2.0",
    "typescript": "^5.1.3",
    "@types/pg": "^8.10.2"
  },
  "engines": {
    "node": "20.3.1"
  },
  "dependencies": {
    "axios": "^1.4.0",
    "cors": "^2.8.5",
    "dotenv": "^16.3.1",
    "express": "^4.18.2",
    "https-proxy-agent": "^7.0.0",
    "knex": "^2.5.0",
    "opencage-api-client": "^1.0.1",
    "pg": "^8.11.0",
    "prettier": "^2.8.8",
    "swagger-jsdoc": "^6.2.8",
    "swagger-ui-express": "^4.6.3",
    "ts-node": "^10.9.1",
    "yamljs": "^0.3.0",
    "zod": "^3.21.4"
  },
  "scripts": {
    "build": "tsc && tsc-alias",
    "start": "node -r tsconfig-paths/register dist/index.js",
    "dev": "nodemon --exec ts-node -r tsconfig-paths/register src/index.ts"
  }
}

My start command is: yarn install && yarn build
My build command is: tsc && tsc-alias:
My NODE_ENV environmental variable is unset on render.com (I didn’t set it manually)

I am aware that this issue has been posted on the forum several times, but none of the solution provided worked for me.

Any ideas what might be going on?

Hi there,

You have got your build and start commands mixed up. I think your Render build command should be yarn install && yarn build (to install modules and run tsc && tsc-alias) and your start command should be yarn start (to run node -r tsconfig-paths/register dist/index.js).

Regards,

Keith
Render Support, UTC+10 :australia:

in my silliness, I completely overlooked this. I’m deployed. Thanks, Keith!

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