Build Node/PNPM version errors

Trying to deploy a new SvelteKit project created with pnpm create cloudflare@latest Build log:
16:21:59.225 Found wrangler.toml file. Reading build configuration...
16:21:59.231 pages_build_output_dir: .svelte-kit/cloudflare
16:21:59.231 Build environment variables: (none found)
16:21:59.338 Successfully read wrangler.toml file.
16:21:59.481 Detected the following tools from environment: [email protected], [email protected]
16:22:00.253 Installing project dependencies: pnpm install
16:22:00.874  ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)
16:22:00.874
16:22:00.874 Your Node version is incompatible with "/opt/buildhome/repo".
16:22:00.874
16:22:00.874 Expected version: >=18.18.0
16:22:00.874 Got: v18.17.1
16:22:00.875
16:22:00.875 This is happening because the package's manifest has an engines.node field specified.
16:22:00.875 To fix this issue, install the required Node version.
16:22:00.907 Error: Exit with error code: 1
16:22:00.907 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
16:22:00.907 at Object.onceWrapper (node:events:652:26)
16:22:00.907 at ChildProcess.emit (node:events:537:28)
16:22:00.907 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
16:22:00.917 Failed: build command exited with code: 1
16:22:03.020 Failed: error occurred while running build command
16:21:59.225 Found wrangler.toml file. Reading build configuration...
16:21:59.231 pages_build_output_dir: .svelte-kit/cloudflare
16:21:59.231 Build environment variables: (none found)
16:21:59.338 Successfully read wrangler.toml file.
16:21:59.481 Detected the following tools from environment: [email protected], [email protected]
16:22:00.253 Installing project dependencies: pnpm install
16:22:00.874  ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)
16:22:00.874
16:22:00.874 Your Node version is incompatible with "/opt/buildhome/repo".
16:22:00.874
16:22:00.874 Expected version: >=18.18.0
16:22:00.874 Got: v18.17.1
16:22:00.875
16:22:00.875 This is happening because the package's manifest has an engines.node field specified.
16:22:00.875 To fix this issue, install the required Node version.
16:22:00.907 Error: Exit with error code: 1
16:22:00.907 at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
16:22:00.907 at Object.onceWrapper (node:events:652:26)
16:22:00.907 at ChildProcess.emit (node:events:537:28)
16:22:00.907 at ChildProcess._handle.onexit (node:internal/child_process:291:12)
16:22:00.917 Failed: build command exited with code: 1
16:22:03.020 Failed: error occurred while running build command
I tried redeploying with specific versions for node and pnpm, but this didn't seem to work?
NODE_VERSION=20.12.2
PNPM_VERSION=9.0.6
NODE_VERSION=20.12.2
PNPM_VERSION=9.0.6
No description
2 Replies
yeehow
yeehowOP8mo ago
Worked when I put those in my wrangler file
[vars]
NODE_VERSION = "20.12.2"
PNPM_VERSION = "9.0.6"
[vars]
NODE_VERSION = "20.12.2"
PNPM_VERSION = "9.0.6"
Do variables set in the dash (outside of wrangler) get ignored during build?
Vlady
Vlady8mo ago
I have the same problem, looks like the dashboard variables are ignored For me it doesn't even pick up the [vars] in wrangler.toml Creating a .node-version package with the contents of v20.13.1 seems to work for me
Want results from more Discord servers?
Add your server