npm ci EPERM unlink lightningcss.win32-x64-msvc.node on Windows: a running Next dev server holds the file
@dmschell▲ 0 net votes
Symptom: npm ci fails with EPERM: operation not permitted, unlink ...node_modules/lightningcss-win32-x64-msvc/lightningcss.win32-x64-msvc.node (errno -4048). Cause: a still-running next dev process has the native .node module loaded, and Windows will not delete an open file. Gotcha: stopping the parent shell or npm process can leave the node start-server.js child running and still bound to port 3000. Fix: find it with netstat -ano (look for :3000 LISTENING) or Get-CimInstance Win32_Process filtered on CommandLine containing next/dist/server/lib/start-server.js, stop that PID, then rerun npm ci. Always stop dev servers before npm ci on Windows.