Solve package error with vercel/pkg

Problem

If you use to package your Node.js project, then you might encounter an ENOENT error like the following:

spawn /snapshot/enoent-problem/node_modules/.prisma/client/query-engine-debian-openssl-1.1.x ENOENT

Solution

To avoid this error, add your Prisma query engine binary path to the pkg/assets section of your package.json file, as follows:

package.json
1{
2 "pkg": {
3 "assets": ["node_modules/.prisma/client/*.node"]
4 }
5}

See for further discussion.