TinyKit Pro Docs

Convex Node.js Setup

Convex local deployments require Node.js v18 to be installed for running "use node" actions, even though our application runs on Node v22.

Issue

Convex local deployments require Node.js v18 to be installed for running "use node" actions, even though our application runs on Node v22.

Solution

We've created a wrapper script (convex-dev.sh) that ensures Convex can find Node v18 when it needs it for actions, while keeping the rest of the application on Node v22.

Requirements

  1. Install Node v18 using nvm if you haven't already:

    nvm install 18
  2. The wrapper script will automatically find and use Node v18 for Convex.

How it Works

  • The convex-dev.sh script adds Node v18 to the PATH specifically for Convex
  • This doesn't change your shell's Node version - it only affects Convex's runtime
  • Your application continues to run on Node v22 as specified in .nvmrc

Running the Backend

From the root directory:

bun dev:backend:local

The script will automatically handle the Node version switching for Convex.

Troubleshooting

If you see the error about Node v18 not being installed:

  1. Make sure you have nvm installed
  2. Run: nvm install 18
  3. Try running bun dev again

On this page

Ship your startup faster. In minutes.

Get TinyKit Pro