Node.js (Linux x64 Distribution)

24.15.0 · active · verified Sun Apr 19

The `node-linux-x64` package provides a pre-compiled Node.js runtime binary specifically for Linux x64 systems, enabling projects to manage a Node.js version (e.g., v24.15.0) as a direct dependency. Node.js is an open-source, cross-platform JavaScript runtime environment built on Chrome's V8 engine, known for its event-driven, non-blocking I/O model, making it ideal for scalable network applications and server-side development. Node.js currently follows a release schedule with new major 'Current' versions every six months (April and October), which may introduce breaking changes. Even-numbered major versions transition to Long Term Support (LTS) in October, receiving 12 months of active support and a further 18 months of maintenance, focusing on stability and security. As of October 2026, Node.js is transitioning to an annual major release cycle where every major version will become an LTS release.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic HTTP server in Node.js, handling root and `/readfile` routes. It showcases ESM syntax for importing built-in modules (http, fs/promises, path, url) and performing asynchronous file operations. It runs an HTTP server and reads a local file.

import * as http from 'http';
import { readFile } from 'fs/promises';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';

const hostname = '127.0.0.1';
const port = 3000;

// __dirname equivalent for ESM
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const server = http.createServer(async (req, res) => {
  res.setHeader('Content-Type', 'text/plain');
  if (req.url === '/') {
    res.statusCode = 200;
    res.end('Hello Node.js World!\n');
  } else if (req.url === '/readfile') {
    try {
      // Assuming a 'sample.txt' file exists in the same directory
      const filePath = join(__dirname, 'sample.txt');
      const content = await readFile(filePath, 'utf8');
      res.statusCode = 200;
      res.end(`File content:\n${content}\n`);
    } catch (error) {
      res.statusCode = 500;
      res.end('Error reading file. Ensure "sample.txt" exists.\n');
    }
  } else {
    res.statusCode = 404;
    res.end('Not Found\n');
  }
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
  console.log(`Visit http://${hostname}:${port}/readfile (requires a 'sample.txt' file)`);
  console.log(`To create 'sample.txt': echo "Hello from sample.txt" > sample.txt`);
});

view raw JSON →