1

As the title says, I'm trying to build a Next.js 15 project on Vercel, and this error is occurring: Error: Command "npm install && npx prisma generate && npm run build" exited with 1. However, everything is installed — Prisma and all dependencies are in place. The weirdest part, and what I think might be the issue, is that just above the error it says: Please install @types/node by running: npm install --save-dev @types/node If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your app and pages directories).

Below, I will include the full Vercel log and the package.json.

[21:31:53.665] Cloning github.com/nadodev/leonardogejanovo (Branch: main, Commit: 152ff2f)
[21:31:54.016] Cloning completed: 351.000ms
[21:31:58.018] Skipping build cache since Node.js version changed from "22.x" to "20.x"
[21:31:58.093] Running build in Washington, D.C., USA (East) – iad1
[21:31:58.266] Running "vercel build"
[21:31:58.655] Vercel CLI 41.6.0
[21:31:58.965] Installing dependencies...
[21:32:34.880] 
[21:32:34.881] added 727 packages in 36s
[21:32:34.881] 
[21:32:34.881] 286 packages are looking for funding
[21:32:34.882]   run `npm fund` for details
[21:32:34.905] Detected Next.js version: 15.3.1
[21:32:34.906] Running "npm install && npx prisma generate && npm run build"
[21:32:37.288] 
[21:32:37.289] removed 1 package, and audited 489 packages in 2s
[21:32:37.289] 
[21:32:37.289] 172 packages are looking for funding
[21:32:37.289]   run `npm fund` for details
[21:32:37.308] 
[21:32:37.308] 7 vulnerabilities (4 low, 3 moderate)
[21:32:37.309] 
[21:32:37.309] To address issues that do not require attention, run:
[21:32:37.309]   npm audit fix
[21:32:37.309] 
[21:32:37.309] To address all issues (including breaking changes), run:
[21:32:37.309]   npm audit fix --force
[21:32:37.309] 
[21:32:37.309] Run `npm audit` for details.
[21:32:38.782] Prisma schema loaded from prisma/schema.prisma
[21:32:38.967] Warning: You did not specify an output path for your `generator` in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0. To learn more visit https://pris.ly/cli/output-path
[21:32:39.297] 
[21:32:39.297] ✔ Generated Prisma Client (v6.6.0) to ./node_modules/@prisma/client in 141ms
[21:32:39.297] 
[21:32:39.297] Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
[21:32:39.298] 
[21:32:39.298] Tip: Want to react to database changes in your app as they happen? Discover how with Pulse: https://pris.ly/tip-1-pulse
[21:32:39.298] 
[21:32:39.537] 
[21:32:39.537] > [email protected] prebuild
[21:32:39.537] > npm install @types/node --save-dev
[21:32:39.537] 
[21:32:41.037] 
[21:32:41.038] up to date, audited 489 packages in 1s
[21:32:41.039] 
[21:32:41.039] 172 packages are looking for funding
[21:32:41.039]   run `npm fund` for details
[21:32:41.059] 
[21:32:41.061] 7 vulnerabilities (4 low, 3 moderate)
[21:32:41.062] 
[21:32:41.062] To address issues that do not require attention, run:
[21:32:41.062]   npm audit fix
[21:32:41.062] 
[21:32:41.062] To address all issues (including breaking changes), run:
[21:32:41.062]   npm audit fix --force
[21:32:41.063] 
[21:32:41.063] Run `npm audit` for details.
[21:32:41.073] 
[21:32:41.073] > [email protected] build
[21:32:41.074] > npm install && npx prisma generate && next build
[21:32:41.074] 
[21:32:42.223] 
[21:32:42.223] up to date, audited 489 packages in 1s
[21:32:42.223] 
[21:32:42.223] 172 packages are looking for funding
[21:32:42.224]   run `npm fund` for details
[21:32:42.254] 
[21:32:42.254] 7 vulnerabilities (4 low, 3 moderate)
[21:32:42.255] 
[21:32:42.255] To address issues that do not require attention, run:
[21:32:42.255]   npm audit fix
[21:32:42.255] 
[21:32:42.255] To address all issues (including breaking changes), run:
[21:32:42.256]   npm audit fix --force
[21:32:42.256] 
[21:32:42.256] Run `npm audit` for details.
[21:32:43.215] Prisma schema loaded from prisma/schema.prisma
[21:32:43.403] Warning: You did not specify an output path for your `generator` in schema.prisma. This behavior is deprecated and will no longer be supported in Prisma 7.0.0. To learn more visit https://pris.ly/cli/output-path
[21:32:43.717] 
[21:32:43.718] ✔ Generated Prisma Client (v6.6.0) to ./node_modules/@prisma/client in 157ms
[21:32:43.718] 
[21:32:43.718] Start by importing your Prisma Client (See: https://pris.ly/d/importing-client)
[21:32:43.718] 
[21:32:43.718] Tip: Want to react to database changes in your app as they happen? Discover how with Pulse: https://pris.ly/tip-1-pulse
[21:32:43.718] 
[21:32:44.427]    Downloading swc package @next/swc-linux-x64-gnu... to /vercel/.cache/next-swc
[21:32:44.600]  ⚠ Found lockfile missing swc dependencies, run next locally to automatically patch
[21:32:45.919]    Downloading swc package @next/swc-linux-x64-musl... to /vercel/.cache/next-swc
[21:32:47.257] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[21:32:47.257] This information is used to shape Next.js' roadmap and prioritize features.
[21:32:47.257] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[21:32:47.257] https://nextjs.org/telemetry
[21:32:47.257] 
[21:32:47.337]    ▲ Next.js 15.3.1
[21:32:47.338] 
[21:32:47.368]    Creating an optimized production build ...
[21:32:47.968]  ⚠ Found lockfile missing swc dependencies, run next locally to automatically patch
[21:33:05.905]  ⚠ Found lockfile missing swc dependencies, run next locally to automatically patch
[21:33:09.223]  ⚠ Found lockfile missing swc dependencies, run next locally to automatically patch
[21:33:24.037]  ✓ Compiled successfully in 32.0s
[21:33:24.044]    Linting and checking validity of types ...
[21:33:24.161] It looks like you're trying to use TypeScript but do not have the required package(s) installed.
[21:33:24.161] 
[21:33:24.162] Please install @types/node by running:
[21:33:24.162] 
[21:33:24.162]  npm install --save-dev @types/node
[21:33:24.162] 
[21:33:24.162] If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your app and pages directories).
[21:33:24.162] 
[21:33:24.182] Next.js build worker exited with code: 1 and signal: null
[21:33:24.209] Error: Command "npm install && npx prisma generate && npm run build" exited with 1
[21:33:24.574] 
{
  "name": "prisma-nextjs",
  "engines": {
    "node": "20.x"
  },
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "npm install && npx prisma generate && next build",
    "prebuild": "npm install @types/node --save-dev",
    "start": "next start",
    "lint": "next lint",
    "prisma:generate": "prisma generate",
    "prisma:migrate": "prisma migrate dev",
    "prisma:studio": "prisma studio",
    "create-user": "node scripts/create-user.js",
    "create-admin": "node scripts/create-admin.js"
  },
  "dependencies": {
    "@auth/prisma-adapter": "^1.0.12",
    "@prisma/client": "^6.6.0",
    "@radix-ui/react-label": "^2.1.4",
    "@radix-ui/react-select": "^2.2.2",
    "@radix-ui/react-slot": "^1.2.0",
    "@tailwindcss/aspect-ratio": "^0.4.2",
    "@tailwindcss/typography": "^0.5.16",
    "@types/antd": "^0.12.32",
    "@types/prismjs": "^1.26.5",
    "@types/react-syntax-highlighter": "^15.5.13",
    "antd": "^5.24.8",
    "autoprefixer": "^10.4.17",
    "bcryptjs": "^2.4.3",
    "class-variance-authority": "^0.7.1",
    "cloudinary": "^2.6.0",
    "clsx": "^2.1.1",
    "date-fns": "^4.1.0",
    "framer-motion": "^12.7.4",
    "jsonwebtoken": "^9.0.0",
    "lucide-react": "^0.501.0",
    "next": "15.3.1",
    "next-auth": "^4.24.0",
    "next-cloudinary": "^6.16.0",
    "postcss": "^8.4.35",
    "prism-react-renderer": "^2.4.1",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "react-hot-toast": "^2.5.2",
      "tw-animate-css": "^1.2.8",
    "react-icons": "^5.5.0",
    "react-markdown": "^10.1.0",
    "react-syntax-highlighter": "^15.6.1",
    "react-to-print": "^3.0.6",
    "rehype-raw": "^7.0.0",
    "remark-gfm": "^4.0.1",
    "resend": "^4.3.0",
    "sonner": "^2.0.3",
    "tailwind-merge": "^3.2.0",
    "tw-animate-css": "^1.2.8"
  },
  "devDependencies": {
    "@types/bcryptjs": "^2.4.6",
    "@types/jsonwebtoken": "^9.0.8",
    "@types/node": "^20.17.30",
    "@types/react": "^18.2.67",
    "@types/react-dom": "^18.2.22",
    "eslint": "^8.57.0",
    "eslint-config-next": "15.3.1",
    "prisma": "^6.6.0",
    "typescript": "^5.4.5"
  }
}

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules"]
}

I've already tried everything—installing dependencies, changing the Node version, and building without cache.

3 Answers 3

1

Solved, I added the next-env.d.ts file

/// ///

// NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

Sign up to request clarification or add additional context in comments.

Comments

0

Is there any reason you add @types/node inside the prebuild ? (You may not need that. you can remove the prebuild or remove installing @types/node in prebuild)

Remove npm install in build step

"build": "npx prisma generate && next build",

and try this version for the node types

"@types/node": "^20.8.10"

1 Comment

I'm using preinstall precisely because it's required at the end of the build, as shown in the log. I don't know why it's required, though. [21:33:24.162] Please install @types/node by running: [21:33:24.162] [21:33:24.162] npm install --save-dev @types/node
0

sometimes u have typescript error in your project first check your project and fix all type scripts then try agin if you are use eslint and you have ts.config use this command your terminal

npx tsc --traceResolution

this command show you all typescript worng . then try to fixed if you dont have any type issue , delete node_modules and package-lock.json then clear npm catch , npm install , then agin try

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.