NestJS and Prisma deploy

I’m trying to deploy my NestJS app with prisma.
it was working normally, but in the last commit it started giving these errors.

Nov 28 11:48:29 PM  ==> Cloning from https://github.com/bBraian/icook-server...
Nov 28 11:48:29 PM  ==> Checking out commit ce23126cc39fdb969c18e79921ad79f780eb3c55 in branch main
Nov 28 11:48:31 PM  ==> Downloading cache...
Nov 28 11:48:44 PM  ==> Transferred 175MB in 7s. Extraction took 4s.
Nov 28 11:48:51 PM  ==> Using Node version 14.17.0 (default)
Nov 28 11:48:51 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Nov 28 11:48:51 PM  ==> Running build command 'npm install; npx prisma generate; npm run build'...
Nov 28 11:48:54 PM  
Nov 28 11:48:54 PM  > prisma@5.5.2 preinstall /opt/render/project/src/node_modules/prisma
Nov 28 11:48:54 PM  > node scripts/preinstall-entry.js
Nov 28 11:48:54 PM  
Nov 28 11:48:54 PM  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
Nov 28 11:48:54 PM  β”‚    Prisma only supports Node.js >= 16.13.    β”‚
Nov 28 11:48:54 PM  β”‚    Please upgrade your Node.js version.      β”‚
Nov 28 11:48:54 PM  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Nov 28 11:48:55 PM  npm ERR! code ELIFECYCLE
Nov 28 11:48:55 PM  npm ERR! errno 1
Nov 28 11:48:55 PM  npm ERR! prisma@5.5.2 preinstall: `node scripts/preinstall-entry.js`
Nov 28 11:48:55 PM  npm ERR! Exit status 1
Nov 28 11:48:55 PM  npm ERR!
Nov 28 11:48:55 PM  npm ERR! Failed at the prisma@5.5.2 preinstall script.
Nov 28 11:48:55 PM  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Nov 28 11:48:55 PM  
Nov 28 11:48:55 PM  npm ERR! A complete log of this run can be found in:
Nov 28 11:48:55 PM  npm ERR!     /opt/render/.cache/_logs/2023-11-29T02_48_55_203Z-debug.log
Nov 28 11:48:56 PM  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
Nov 28 11:48:56 PM  β”‚    Prisma only supports Node.js >= 16.13.    β”‚
Nov 28 11:48:56 PM  β”‚    Please upgrade your Node.js version.      β”‚
Nov 28 11:48:56 PM  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Nov 28 11:48:56 PM  npm ERR! code ELIFECYCLE
Nov 28 11:48:56 PM  npm ERR! errno 1
Nov 28 11:48:56 PM  npm ERR! prisma@5.6.0 preinstall: `node scripts/preinstall-entry.js`
Nov 28 11:48:56 PM  npm ERR! Exit status 1
Nov 28 11:48:56 PM  npm ERR!
Nov 28 11:48:56 PM  npm ERR! Failed at the prisma@5.6.0 preinstall script.
Nov 28 11:48:56 PM  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Nov 28 11:48:56 PM  
Nov 28 11:48:56 PM  npm ERR! A complete log of this run can be found in:
Nov 28 11:48:56 PM  npm ERR!     /opt/render/.cache/_logs/2023-11-29T02_48_56_896Z-debug.log
Nov 28 11:48:56 PM  Install for [ 'prisma@latest' ] failed with code 1
Nov 28 11:48:57 PM  
Nov 28 11:48:57 PM  > icook-server@0.0.1 build /opt/render/project/src
Nov 28 11:48:57 PM  > nest build
Nov 28 11:48:57 PM  
Nov 28 11:48:57 PM  sh: 1: nest: not found
Nov 28 11:48:57 PM  npm ERR! code ELIFECYCLE
Nov 28 11:48:57 PM  npm ERR! syscall spawn
Nov 28 11:48:57 PM  npm ERR! file sh
Nov 28 11:48:57 PM  npm ERR! errno ENOENT
Nov 28 11:48:57 PM  npm ERR! icook-server@0.0.1 build: `nest build`
Nov 28 11:48:57 PM  npm ERR! spawn ENOENT
Nov 28 11:48:57 PM  npm ERR!
Nov 28 11:48:57 PM  npm ERR! Failed at the icook-server@0.0.1 build script.
Nov 28 11:48:57 PM  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Nov 28 11:48:57 PM  
Nov 28 11:48:57 PM  npm ERR! A complete log of this run can be found in:
Nov 28 11:48:57 PM  npm ERR!     /opt/render/.cache/_logs/2023-11-29T02_48_57_149Z-debug.log
Nov 28 11:48:57 PM  ==> Build failed 😞

My package.josn is

{
  "name": "icook-server",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "nest start",
    "dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json"
  },
  "dependencies": {
    "@nestjs/cli": "^10.0.0",
    "@nestjs/common": "^10.0.0",
    "@nestjs/core": "^10.0.0",
    "@nestjs/jwt": "^10.1.1",
    "@nestjs/mapped-types": "*",
    "@nestjs/passport": "^10.0.2",
    "@nestjs/platform-express": "^10.0.0",
    "@prisma/client": "5.5.2",
    "bcrypt": "^5.1.1",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.14.0",
    "node": "18",
    "passport": "^0.6.0",
    "passport-jwt": "^4.0.1",
    "passport-local": "^1.0.0",
    "prisma": "5.5.2",
    "reflect-metadata": "^0.1.13",
    "rxjs": "^7.8.1"
  },
  "devDependencies": {
    "@nestjs/schematics": "^10.0.0",
    "@nestjs/testing": "^10.0.0",
    "@types/bcrypt": "^5.0.1",
    "@types/express": "^4.17.17",
    "@types/jest": "^29.5.2",
    "@types/node": "^20.3.1",
    "@types/passport-jwt": "^3.0.12",
    "@types/passport-local": "^1.0.37",
    "@types/supertest": "^2.0.12",
    "@typescript-eslint/eslint-plugin": "^6.0.0",
    "@typescript-eslint/parser": "^6.0.0",
    "eslint": "^8.42.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-prettier": "^5.0.0",
    "jest": "^29.5.0",
    "prettier": "^3.0.0",
    "source-map-support": "^0.5.21",
    "supertest": "^6.3.3",
    "ts-jest": "^29.1.0",
    "ts-loader": "^9.4.3",
    "ts-node": "^10.9.1",
    "tsconfig-paths": "^4.2.0",
    "typescript": "^5.1.3"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}

Build Command

npm install; npx prisma generate; npm run build

Hi,

The message shows:

Prisma only supports Node.js >= 16.13.
Please upgrade your Node.js version.

Maybe you need to set your Node version?

Alan

1 Like

I had seen this message. I didn’t think this was what was causing the bug because the project was already running and when I sent a commit to simply update some SQL code, it stopped.

I already had a similar problem and the solution was to specify the node version in package.json, but now I had to do it in a different way

The solution was to add the following to package.json:
β€œengines”: {
β€œnode”: β€œ>=18.18.0 <19.0.0”
}

Or add a variable with the key NODE_VERSION and no value to your version in the environment section

here the ref link Setting Your Node.js Version | Render Docs

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