GrepBoard/Manuals
605 manuals ·

Node.js & npm 7

npm install errors, permissions and ES module errors.

  1. Fix gyp ERR! find Python and Error: not found: make

    gyp ERR! find Python or Error: not found: make means npm has no tools to build a native module. Install python3, make and g++, or use a prebuilt binary.

    Node.js 22.23.4 · npm 10.9.9 · node-gyp 11.5.0 · Debian 12 (Docker node:22-slim) · 2026-10
  2. Fix npm install -g EACCES: permission denied without sudo

    npm install -g fails with EACCES permission denied when the global folder is owned by root. Move npm's prefix to ~/.local and fix PATH instead of using sudo.

    Node.js 22.23.4 · npm 10.9.9 (Docker node:22-slim) · 2026-10
  3. Fix npm ENOENT: Could not read package.json

    npm ENOENT Could not read package.json means the folder npm uses as the project has no package.json. Read the path line, then cd or use --prefix.

    Node.js 22.23.4 · npm 10.9.9 · npm 9.9.4 · npm 11.19.1 (Docker node:*-slim) · 2026-10
  4. Fix SyntaxError: Cannot use import statement outside a module

    Cannot use import statement outside a module means Node loaded the file as CommonJS. Check package.json type and Node version; fix ERR_REQUIRE_ESM too.

    Node.js 18.20.8 · 20.20.2 · 22.23.4 · 24.22.1 (Docker node:*-slim) · 2026-10
  5. Fix error:0308010C:digital envelope routines::unsupported

    webpack 4 on Node 22 or 24 failing with error:0308010C digital envelope routines::unsupported is the md4 hash. Upgrade to 4.47.0; legacy flag only briefly.

    Node.js 22.23.4 · OpenSSL 3.5.9 · webpack 4.46.0 · 4.47.0 (Docker node:22-slim) · 2026-10
  6. Node.js --max-old-space-size: Fix JavaScript heap out of memory

    JavaScript heap out of memory means Node hit the V8 heap limit. Read heap_size_limit, then set --max-old-space-size below the container memory limit.

    Node.js 22.23.4 (node:22-slim Docker · 512 MB, 1 GB, 4 GB containers) · 2026-10
  7. Fix npm ERR! code ERESOLVE: unable to resolve dependency tree

    npm ERESOLVE unable to resolve dependency tree means a peer requirement clashes with your project's version. Read the Found and peer lines, then align them.

    Node.js 22.23.4 · npm 10.9.9 (Docker node:22-slim) · 2026-10