Skip to content

Commit

Permalink
fix(get-platform): remove x32 in isNodeAPISupported()
Browse files Browse the repository at this point in the history
isNodeAPISupported was added to test the Windwos 32bit node problem
https://github.com/prisma/ecosystem-tests/pull/1830/files
And it only returns ia32

Note that x32 was removed in Node 16+, see https://github.com/nodejs/node/pull/41905/files#diff-5212ec434ff69f31e0de5e7e6f57abd45d810780c60f05736ab31eae5a395186
  • Loading branch information
Jolg42 committed Apr 28, 2023
1 parent ab1b09f commit bd95557
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/get-platform/src/isNodeAPISupported.ts
Expand Up @@ -3,10 +3,10 @@ import fs from 'fs'
/**
* Determines whether Node API is supported on the current platform and throws if not
*/
export function isNodeAPISupported() {
export function isNodeAPISupported(): void {
const customLibraryPath = process.env.PRISMA_QUERY_ENGINE_LIBRARY
const customLibraryExists = customLibraryPath && fs.existsSync(customLibraryPath)
if (!customLibraryExists && (process.arch === 'x32' || process.arch === 'ia32')) {
if (!customLibraryExists && process.arch === 'ia32') {
throw new Error(
`The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set \`engineType = "binary"\` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)`,
)
Expand Down

0 comments on commit bd95557

Please sign in to comment.