Problem
- You want to use Claude Code in an old project
- The project needs old Node version
- Claude Code requires a modern Node version to run (https://docs.claude.com/en/docs/claude-code/getting-started#system-requirements)
- You can’t run both in the same environment
Simple solution is open that project in a docker container. By containerizing your legacy application, you can maintain a modern Node version on your host machine for Claude Code while running your old project in an isolated environment.
Step1: Configure Your Host Environment
First, set up a modern Node version so Claude Code can run properly. Create or update your .node-version file in your project directory:
22.20.0Or even somewhere else like a parent directory one level above is fine. Claude Code will find and use it either way.
Step2: Create a Docker Container
Now you’ll containerize your legacy application. Here’s an example for an ancient Nuxt version2 project running on Node 10 (yes, it’s the Ice Age software).
dockerfile
FROM node:10.22.0
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY yarn.lock* ./
# Install dependencies
RUN yarn install
# Copy .env file
COPY .env* ./
# Expose the port that Nuxt dev server runs on
EXPOSE 9000
# Start the development server
# Start the development server
# Note: --hostname 0.0.0.0 is required to make the server accessible from outside the container
# Instead of CMD ["yarn", "dev"]
CMD ["sh", "-c", "yarn install && yarn nuxt-ts --port 9000 --hostname 0.0.0.0"]docker-compose.yml
version: "3.8"
services:
  nuxt-app:
    build: .
    ports:
      - "9000:9000"
    volumes:
      # Share source code with the container
      - .:/app
      # Use container's node_modules (don't override with host)
      - /app/node_modules
    environment:
      - NODE_ENV=development
    stdin_open: true
    tty: trueThen just normally docker-compose.
docker-compose up --build -dNow you have both Claude Code and a legacy project up and running.
Other Solution
Or if it’s a simple project and you don’t even have to create a docker container, you can simply
- Open the project from a parent directory
- Open Claude in the parent directory
- Let the Claude work in the child directory from there
