Cannot build using the latest node version

I have a vite project that has a dependency that requires latest node version.

I added .nvmrc with NODE_VERSION=20.14.0,

but on the logs it says:

11:22:49.520	Using v2 root directory strategy
11:22:49.548	Success: Finished cloning repository files
11:22:51.216	Checking for configuration in a wrangler.toml configuration file (BETA)
11:22:51.305	No wrangler.toml file found. Continuing.
11:22:52.538	Detected the following tools from environment: nodejs@NODE_VERSION=20.14.0
11:22:52.538	, [email protected]
11:22:52.538	Installing nodejs NODE_VERSION=20.14.0
11:22:53.129	Trying to update node-build... ok
11:22:53.165	node-build: definition not found: node_version=20.14.0
11:22:53.173	Error: Exit with error code: 1
11:22:53.173	    at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
11:22:53.174	    at Object.onceWrapper (node:events:652:26)
11:22:53.174	    at ChildProcess.emit (node:events:537:28)
11:22:53.174	    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
11:22:53.183	Failed: build command exited with code: 1
11:22:54.002	Failed: error occurred while running build command

Fixed by removing nvmrc and adding NODE_VERSION in the environment variables

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

Hi @dev349,

We really appreciate your time letting us know what the solution was!
Your contribution will definitely help other users in the future.