Error - about prisma developon Vercel

prisma vercel error

answer in the website [Document]

https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/vercel-caching-issue

bash 复制代码
Prisma has detected that this project was built on Vercel, which caches dependencies.
This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered.
To fix this, make sure to run the `prisma generate` command during the build process.

Learn how: https://pris.ly/d/vercel-build

Solution1:

Within the scripts section of your project's package.json file, if there is not already a script named postinstall, add one and add prisma generate to that script:

复制代码
{  ...  "scripts" {    "postinstall": "prisma generate"  }  ...}

The application's build script in package.json

Within the scripts section of your project's package.json file, within the build script, prepend prisma generate to the default vercel build command:

复制代码
{  ...  "scripts" {    "build": "prisma generate && <actual-build-command>"  }  ...}

vercel

add

Vercel UI's build script field

Another way to configure prisma generate to be run on every deployment is to add the command to the build settings via Vercel's UI.

Within your project's dashboard, go to the Settings tab and find the General section. In that section you will find a box labeled Build & Development Settings that contains an input field named Build Command:

Within that field, prepend prisma generate to the existing script:

相关推荐
ZYMFZ2 分钟前
HAProxy 简介及配置
linux·负载均衡·haproxy
敲上瘾3 分钟前
Linux系统C++开发环境搭建工具(三)—— brpc使用指南
linux·c++·分布式·rpc
李少兄16 分钟前
解决 CentOS 8 报错:Failed to download metadata for repo ‘BaseOS‘
linux·运维·centos
杜子不疼.22 分钟前
Linux】 性能调优实战:内核参数优化技巧
linux·运维·php
墨寒博客栈1 小时前
Linux基础常用命令
java·linux·运维·服务器·前端
重生之我在20年代敲代码1 小时前
【Linux网络编程】初识网络,理解TCP/IP五层模型
linux·运维·服务器·网络
**蓝桉**1 小时前
服务器管理
linux·笔记
疯狂的小强呀1 小时前
如何利用 Jupyter 从浏览器访问远程服务器
服务器·jupyter·浏览器访问服务器·jupyter远程访问服务器
GalaxyPokemon1 小时前
PlayerFeedback 插件开发日志
java·服务器·前端
没枕头我咋睡觉1 小时前
【运维】ubuntu修改镜像源
linux·运维·ubuntu