Why can't i build my nextjs app?

Hi, I’m struggling to deploy my nextjs app because of this error. I can deploy other nextjs apps just not this current one.

=> ERROR [build 3/6] RUN npm ci --include=dev 0.8s

[build 3/6] RUN npm ci --include=dev:
0.823 npm error code EBADPLATFORM
0.824 npm error notsup Unsupported platform for @next/swc-win32-x64-msvc@14.2.13: wanted {“os”:“win32”,“cpu”:“x64”} (current: {“os”:“linux”,“cpu”:“x64”})
0.824 npm error notsup Valid os: win32
0.824 npm error notsup Actual os: linux
0.824 npm error notsup Valid cpu: x64
0.824 npm error notsup Actual cpu: x64
0.825
0.826 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-11-05T13_56_46_790Z-debug-0.log


Error: failed to fetch an image or build from source: error building: failed to solve: process “/bin/sh -c npm ci --include=dev” did not complete successfully: exit code: 1

To clarify im not on linux. im on windows

Fly machines are linux based, you need to deploy on CI/CD or use WSL locally.

oh right. but how comes it lets me deploy a different nextjs site that is very similar on windows.

I wouldn’t know w/o looking but it probably doesn’t depend on platform specific libs. Maybe you’re doing npm i instead of npm ci

Perhaps that other app isn’t using swc?

Can you post your package.json from the app that isn’t working?

{
“name”: “jktowingandrecovery”,
“version”: “0.1.0”,
“private”: true,
“scripts”: {
“dev”: “next dev”,
“build”: “next build”,
“start”: “next start”,
“lint”: “next lint”
},
“dependencies”: {
@heroicons/react”: “^2.1.5”,
@next/swc-win32-x64-msvc”: “^14.2.13”,
@next/third-parties”: “^14.2.12”,
@radix-ui/react-dialog”: “^1.1.1”,
@radix-ui/react-hover-card”: “^1.1.2”,
@radix-ui/react-navigation-menu”: “^1.2.0”,
@radix-ui/react-separator”: “^1.1.0”,
@radix-ui/react-slot”: “^1.1.0”,
@relume_io/relume-tailwind”: “^0.5.1”,
@relume_io/relume-ui”: “^0.5.1”,
@tabler/icons-react”: “^3.17.0”,
“aos”: “^2.3.4”,
“class-variance-authority”: “^0.7.0”,
“clsx”: “^2.1.1”,
“embla-carousel-autoplay”: “^8.3.1”,
“embla-carousel-react”: “^8.3.0”,
“framer-motion”: “^11.5.4”,
“lucide-react”: “^0.438.0”,
“mini-svg-data-uri”: “^1.4.4”,
“next”: “^14.2.13”,
“next-themes”: “^0.3.0”,
“qss”: “^3.0.0”,
“react”: “^18.3.1”,
“react-dom”: “^18.3.1”,
“react-scroll”: “^1.9.0”,
“sharp”: “^0.33.5”,
“simplex-noise”: “^4.0.3”,
“smooth-scroll”: “^16.1.3”,
“tailwind-merge”: “^2.5.2”,
“tailwindcss-animate”: “^1.0.7”
},
“devDependencies”: {
@flydotio/dockerfile”: “^0.5.9”,
@types/node”: “^20”,
@types/react”: “^18”,
@types/react-dom”: “^18”,
“eslint”: “^8”,
“eslint-config-next”: “14.2.8”,
“postcss”: “^8”,
“tailwindcss”: “^3.4.1”,
“typescript”: “^5”
}
}

windows

sorry i dont understand

You have a windows specific dependency in your app. You can’t build that for a non-windows platform.

1 Like

ah understood. i removed it and it works fine now. thanks a lot.