Issue with Build Configuration

Hi guys!

I'm trying to deploy my Next.js 15 app on Cloudflare for the first time and I want to change it's default npm install to npm install --legacy-peer-deps instead

I already went to my project Settings > Build Configuration >

Set:
Framework: Next.js
Build command: npm install --legacy-peer-deps && npx @cloudflare/next-on-pages@1
Build output directory: .vercel/output/static

I also created a wrangler.toml
name = "my-app"
compatibility_date = "2024-09-23"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = ".vercel/output/static"

[build]
  command = '''
    if [ "$CF_PAGES_BRANCH" = "main" ]; then
      npm install --legacy-peer-deps;
    else
      npm install;
    fi
    npx @cloudflare/next-on-pages
  '''


Both still don't work, thanks for the help!
Was this page helpful?