Unable to run Next.js app

Monkk

New member
Joined
Oct 17, 2025
Messages
1
Location
Sweden
Hi,

I'm stuck and would really appreciate your help.

I'm trying to run a Next.js app using the “Setup Node.js App” feature in DirectAdmin.

The app was created with the command npx create-next-app@latest using the default options: TypeScript, ESLint, src/directory, and App Router all set to Yes. It runs perfectly on localhost — I haven’t changed anything in the generated project.

I then created an application in DirectAdmin, selected the correct version, set the application mode to Production, and created a server.js-file and pointed it as the Application startup file.

Everything works fine when I run a simple server.js test file. I've connected via SSH and used GitLab to upload all files. But when I try to build (npm run build after npm install) I run into problems:

1. With TypeScript enabled, the build fails because TypeScript isn’t found (even though it’s only listed in devDependencies):

Installing TypeScrip as it was not found while loading "next-config.ts" [...] "Build error occurred [Error: Cannot find module 'typescript']

2. After that, I deleted the app in DirectAdmin, removed all files both locally and on the web hotel, created a new app in DirectAdmin, and generated a new Next.js project — this time without TypeScript.
And guess what? I now get an error related to ESLint:

ESLint must be installed in order to run during builds

Any clue to what I do wrong?

Versions:
  • Node.js 22.18.0
  • Next.js 15.5.6
Package.json (without TypeScript-version)

{
"name": "theprojectsname",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint"
},
"dependencies": {
"react": "19.1.0",
"react-dom": "19.1.0",
"next": "15.5.6"
},
"devDependencies": {
"eslint": "^9",
"eslint-config-next": "15.5.6",
"@eslint/eslintrc": "^3"
}
}

Server.js file I created (doesn't come with the Next.js-project)
const { createServer } = require('http');
const next = require('next');
const port = process.env.PORT || 3000;
const app = next({ dev: false }); // produktionsläge
const handle = app.getRequestHandler();
app.prepare().then(() => {
createServer((req, res) => handle(req, res)).listen(port, () => {
console.log(`✅ Next.js SSR running on port ${port}`);
});
});
 
Last edited:
Back
Top