Unable to run Next.js app

Monkk

New member
Joined
Oct 17, 2025
Messages
2
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:
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):



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:



Any clue to what I do wrong?

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



Server.js file I created (doesn't come with the Next.js-project)
Hi @Monkk — the issue is that DirectAdmin installs only production dependencies, but Next.js needs TypeScript or ESLint during build.

Fix options:
  1. Build locally (npm install && npm run build) → upload the .next folder and run node server.js.
  2. Or, build on the server with:
    <span><span>npm install --include=dev<br>npm run build<br>npm prune --production<br></span></span>
  3. Or, disable checks during build:
    <span><span>NEXT_DISABLE_ESLINT=1<br>NEXT_DISABLE_TYPECHECK=1<br></span></span>
Your setup is fine — just ensure dev tools are available or skipped during the build.
 
Thank you so much!

I've tried installing them separately before, but npm install --include=dev seems to take me a step further.

After running choice number 2, npm install --include=dev and npm run build, I get:
[...]

uncaughtException [Error: spawn /opt/alt/alt-nodejs22/root/usr/bin/node EAGAIN] {
errno: -11,
code: 'EAGAIN',
syscall: 'spawn /opt/alt/alt-nodejs22/root/usr/bin/node',
path: '/opt/alt/alt-nodejs22/root/usr/bin/node',
spawnargs: [Array]
}
node:events:496
throw er; // Unhandled 'error' event
^

Error: kill EPERM
at ChildProcess.kill (node:internal/child_process:511:26)
at cleanupWorkers (/home/XX/nodevenv/domains/XX.se/public_html/22/lib/node_modules/next/dist/lib/worker.js:31:85)
at Worker.close (/home/XX/nodevenv/domains/XX.se/public_html/22/lib/node_modules/next/dist/lib/worker.js:187:13)
at process.<anonymous> (/home/XX/nodevenv/domains/XX.se/public_html/22/lib/node_modules/next/dist/lib/worker.js:47:18)

[...]

[... lines matching original stack trace ...]
at process._fatalException (node:internal/process/execution:155:25) {
errno: -1,
code: 'EPERM',
syscall: 'kill'

I did a quick search, but unsure what to trust :D Does this mean I need to disable checks after all? Disable workerThreads in next.config or ask the web host to increase the CPU?
 
Back
Top