Tsc node found when i yarn build

Apr 24 04:14:49 AM error bson@5.2.0: The engine "node" is incompatible with this module. Expected version ">=14.20.1". Got "14.17.0" Apr 24 04:14:49 AM error Found incompatible module. Apr 24 04:14:49 AM info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Apr 24 04:14:49 AM yarn run v1.22.5 Apr 24 04:14:49 AM $ NODE_ENV=production tsc Apr 24 04:14:49 AM /bin/sh: 1: tsc: not found Apr 24 04:14:49 AM error Command failed with exit code 127. Apr 24 04:14:49 AM info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Apr 24 04:14:49 AM ==> Build failed 😞 Apr 24 04:14:49 AM ==> Generating container image from build. This may take a few minutes...

package : “scripts”: {
“start”: “node ./dist/bin/www.js”,
“build”: “sh etc/build.sh”,
“lint”: “eslint ./src//*.ts",
“format”: "eslint ./src/
/*.ts --fix”
},

build.sh :
rimraf dist

export NODE_ENV=production

tsc -p ./tsconfig.build.json --pretty

cp package.json dist/

Hi there,

Please see https://render.com/docs/node-version for details how to resolve this error you are getting,

Regards,

John B

1 Like

I change somthing, Build Command : npm install ; yarn; yarn build , it run oke , then yarn start have error. cant not file dist/bin

if i change  package.json , it works oke
 { "scripts": {
    "dev": "set NODE_ENV=dev&&nodemon --exec ts-node ./bin/www.ts",
    "start": "node .dist/bin/www.js" => to "node ./bin/www.js"
    "build": "sh etc/build.sh"  => "tsc"
    "lint": "eslint ./src/**/*.ts",
    "format": "eslint ./src/**/*.ts --fix"
  },}

is there any way to make it run in dist folder?

help me

Hey,

it all depends on where your yarn build command is outputting the build to, this isn’t anything specific to Render. If you run the same commands locally then you should be able to duplicate the issue and be able to fix it (assuming you don’t have a .dist folder locally already.

Regards,

John B

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