Skip to content
Nilay Kabariya

Part 02 of the notebook

FIXED

Fixes

Exact error message, why it happens, the fix that worked, versions tested. Errors I hit while building. Search your exact error message and the fix is at the top.

press / and paste your error.

By topic:Node.js (33)npm (25)Windows (15)TypeScript (9)ES modules (8)Python (8)Tailwind CSS (3)

Entries

  1. No.094

    Python CERTIFICATE_VERIFY_FAILED, tested on 3.12 to 3.15

    certificate verify failed: unable to get local issuer certificate, or Basic Constraints of CA cert not marked critical on Python 3.13+. Each cause tested.

    > requests.exceptions.SSLError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/

    FIXED3 minWindows
  2. No.093

    Fix: bigint Failed to load bindings, pure JS will be used

    bigint: Failed to load bindings, pure JS will be used. Why npm 12 shows it on every install, whether it matters, and how to get the native build back.

    > bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)

    FIXED3 minWindows
  3. No.091

    Fix: npm error code EALLOWREMOTE (and EALLOWGIT), tested

    npm error code EALLOWREMOTE: Fetching packages of type remote have been disabled. Every case reproduced on npm 12, from npx to npm ci, with each fix.

    > npm error code EALLOWREMOTE

    FIXED4 min
  4. No.090

    Node 26 error: libatomic.so.1 cannot open shared object file

    node or npm fails with error while loading shared libraries: libatomic.so.1 after moving to Node 26. Tested on 9 Linux images, Docker and nvm, with fixes.

    > node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory

    FIXED4 min
  5. No.086

    npm error code EACCES: permission denied, 3 causes tested

    npm error code EACCES with syscall mkdir or open: a global install, a cache that sudo left behind, or Docker. Each reproduced, with the fix that lasts.

    > npm error code EACCES

    FIXED2 min
  6. No.085

    npm warn EBADENGINE Unsupported engine, tested

    EBADENGINE is only a warning, until it isn't. Tested with Vite and React Router on Node 20 and 22: when npm warns, when it fails, and when it says nothing.

    > npm warn EBADENGINE Unsupported engine {

    FIXED4 min
  7. No.084

    npm error Invalid Version: lockfile or package.json?

    "Invalid Version: 7.0" (capital V) comes from package-lock.json and breaks npm ci; "Invalid version: patch" is your own version field. Tested on npm 11, 12.

    > npm error Invalid Version: 7.0

    FIXED3 min
  8. No.083

    ModuleNotFoundError: No module named X, but it's installed

    pip installed it into one Python and your code runs another: a venv not activated, a Jupyter kernel, a second Python. Five cases reproduced, and the check.

    > Traceback (most recent call last):

    FIXED3 min
  9. No.082

    No module named 'pkg_resources': setuptools 82 removed it

    Installing setuptools no longer fixes it: setuptools 82 dropped pkg_resources, and 3.12+ venvs ship without setuptools. Tested with pip, uv and TensorBoard.

    > Traceback (most recent call last):

    FIXED3 min
  10. No.080

    Fix: No 'Access-Control-Allow-Origin' header is present

    Blocked by CORS policy, but Postman and curl work fine. Five versions of the error reproduced in Chrome with Express and Vite, and which fix fits each.

    > Access to fetch at 'http://localhost:3001/plain/data' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

    FIXED3 min
  11. No.077

    ReferenceError: process is not defined in Vite (dev vs build)

    In Vite 8, process.env.X crashes in dev but is silently undefined in the build; NODE_ENV works in both. Tested in Chromium: import.meta.env, define, polyfills.

    > Uncaught ReferenceError: process is not defined

    FIXED3 min
  12. No.076

    The punycode module is deprecated (DEP0040): why only builds show it

    Node 20 never prints DEP0040; Node 22+ prints it for your own code and bundles, not node_modules. Usually node-fetch 2 via whatwg-url, not tough-cookie or ajv.

    > (node:24108) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

    FIXED3 min
  13. No.075

    Python was not found, or pip not recognized (Windows fix)

    "Python was not found" comes from a Microsoft Store placeholder python.exe, not Python, and exits with 9009. How to see which python.exe wins, and the pip fix.

    > Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.

    FIXED3 minWindows
  14. No.074

    pip error: externally-managed-environment, tested on 8 systems

    Ubuntu 24.04+, Debian 12+ and Homebrew Python block pip install; Ubuntu 22.04, Fedora and Docker python images don't. Which fix to use: venv, uv, pipx or apt.

    > error: externally-managed-environment

    FIXED4 min
  15. No.073

    Fix: git 'Filename too long' on Windows (clone, checkout)

    git clone fails on Windows with Filename too long and unable to checkout working tree. Reproduced with a 286-character path, plus how to rescue the clone.

    > error: unable to create file node_modules/@some-scope/…/an-equally-long-file-name-for-the-generated-component-module.js: Filename too long

    FIXED2 minWindows
  16. No.072

    npm error code ENOENT, and spawn npx ENOENT on Windows

    Read the path line first. On Windows, spawn npx ENOENT has a twist: adding .cmd now fails with EINVAL. Four ENOENT causes reproduced, each with its fix.

    > npm error code ENOENT

    FIXED3 minWindows
  17. No.071

    Fix: JavaScript heap out of memory (Node.js, tested)

    FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory. Default limits measured, and two ways the usual fix silently fails.

    > FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

    FIXED2 minWindows
  18. No.070

    No module named 'distutils' on Python 3.12+ (node-gyp, setuptools)

    Python 3.12 removed distutils. setuptools brings it back for Python code; npm installs need a newer npm (node-gyp 10+); msvccompiler needs setuptools below 74.

    > ModuleNotFoundError: No module named 'distutils'

    FIXED3 min
  19. No.069

    Fix: EBUSY: resource busy or locked (npm, Windows)

    npm install and Node fail on Windows with EBUSY: resource busy or locked, rmdir. Reproduced: what holds the folder, how to find it, and why retrying fails.

    > npm error code EBUSY

    FIXED3 minWindows
  20. No.068

    Fix: self-signed certificate in certificate chain (npm)

    npm install and fetch() fail with SELF_SIGNED_CERT_IN_CHAIN behind a company proxy. Reproduced on Windows and Linux: which fixes work, and two that don't.

    > npm error code SELF_SIGNED_CERT_IN_CHAIN

    FIXED3 minWindows
  21. No.065

    No matching distribution found for torch: 5 causes, tested

    pip says Could not find a version that satisfies the requirement torch (from versions: none). Five causes reproduced on Windows, and the fix for each.

    > ERROR: Could not find a version that satisfies the requirement torch (from versions: none)

    FIXED4 minWindows
  22. No.064

    Fix: Microsoft Visual C++ 14.0 or greater is required

    pip install fails on Windows asking for Microsoft C++ Build Tools. Four causes reproduced, Failed building wheel for pyyaml fixed, and when Build Tools help.

    > error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

    FIXED7 minWindows
  23. No.062

    npm ci EUSAGE: lock file not in sync (6 causes, tested)

    npm ci says package.json and package-lock.json aren't in sync. Six causes reproduced on npm 11 and 12, and the line in the error that tells them apart.

    > npm error code EUSAGE

    FIXED4 min
  24. No.061

    npm error code ETARGET: No matching version found (5 causes)

    npm error code ETARGET: no matching version found, sometimes with a date before. Five causes reproduced on npm 11 and 12, with the fix for each.

    > npm error code ETARGET

    FIXED5 min
  25. No.056

    ESLint "couldn't find an eslint.config.* file" (ESLint 10)

    ESLint 10 dropped .eslintrc for good, and the old escape hatch is gone. Reproduced on 10.12.0, plus the React and Next.js plugin errors that follow.

    > Oops! Something went wrong! :(

    FIXED4 min
  26. No.051

    Bun "error: Cannot find module": every cause, tested

    Bun prints the same Cannot find module error for six different problems. Each one reproduced on Bun 1.4.2 on Windows and Linux, with the fix that worked.

    > error: Cannot find module '@mono/ui' from 'D:\nk-repro\bun-cnf\e-mono\apps\web\index.ts'

    FIXED9 minWindows
  27. No.040

    Fix: "Could not locate the bindings file" in sqlite3

    sqlite3 or better-sqlite3 installed fine, then can't find its .node file. Four causes reproduced, how the Tried: paths tell them apart, and the fix for each.

    > Error: Could not locate the bindings file. Tried:

    FIXED3 min
  28. No.038

    Fix: Puppeteer "Could not find Chrome (ver. …)"

    Puppeteer can't find Chrome though npm install worked. Six causes reproduced on Windows and Linux, including npm 12, upgrades and Docker, each with its fix.

    > Error: Could not find Chrome (ver. 154.0.8037.57). This can occur if either

    FIXED5 minWindows
  29. No.034

    Fix: npm error Missing script: "dev" (and "start")

    npm can't find the script you asked for. Six real causes, from a stray package.json up the tree to monorepos, and two commands that show which one you have.

    > npm error Missing script: "dev"

    FIXED5 min
  30. No.027

    Angular compilation initialization failed on TypeScript 7

    Angular 22 crashes on TypeScript 7 with reading 'Error', not the usual version warning. What actually failed, and the setup that builds with tsc 7, tested.

    > Application bundle generation failed. [0.412 seconds]

    FIXED3 min
  31. No.026

    Fix: Dynamic require of "react" / "fs" is not supported

    esbuild's ES module output throws this for a require() it left in the bundle. Four fixes tested on Node 24, plus the case only Cloudflare Workers hits.

    > throw Error('Dynamic require of "' + x + '" is not supported');

    FIXED3 min
  32. No.023

    Fix: TypeScript enum is not supported in strip-only mode

    Node's ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX for enum, parameter properties, namespace, export = and import =. Two ways to run it unchanged, both tested.

    > enum Color { Red, Green }

    FIXED4 min
  33. No.021

    Fix: typescript-eslint does not support TS 7.0 (ESLint on TS 7)

    When typescript-eslint will support TypeScript 7, why npm refuses the install, and the setup that keeps TypeScript 7 while ESLint runs normally today.

    > npm error code ERESOLVE

    FIXED4 min
  34. No.018

    "Cannot find native binding" in Vite 8: the missing @rolldown file

    Vite 8 fails with "Cannot find native binding" and names @rolldown/binding-wasm32-wasi? That's a fallback, not your missing package. Both causes, and the fix.

    > Error: Cannot find native binding. npm has a bug related to optional dependencies

    FIXED8 minWindows
  35. No.017

    Fix: Failed to load PostCSS config (module is not defined) in Vite

    Vite can't load your PostCSS config, sometimes one you didn't know existed. The three causes, how to tell which you have from the message, and what fixes each.

    > [plugin vite:css] C:/project/src/style.css

    FIXED6 min
  36. No.016

    Fix: 'vite' is not recognized as an internal or external command

    Windows says the command doesn't exist, but it's right there in node_modules. Five causes, how to tell them apart in one command, and what each one needs.

    > 'vite' is not recognized as an internal or external command,

    FIXED5 minWindows
  37. No.015

    Fix: Cannot read properties of undefined (reading 'fileExists')

    ts-node and webpack's ts-loader crash with this on TypeScript 7, before your code even runs. Which versions do it, why npm didn't warn you, and four ways out.

    > C:\project\node_modules\ts-node\dist\configuration.js:91

    FIXED4 min
  38. No.014

    Fix: This syntax is not allowed when 'erasableSyntaxOnly' is enabled

    TS1294: TypeScript rejects your enum, namespace or constructor shorthand. Why new projects turn this on, what each piece becomes, and when to switch it off.

    > src/a.ts(1,6): error TS1294: This syntax is not allowed when 'erasableSyntaxOnly' is enabled.

    FIXED3 min
  39. No.013

    Fix: ERR_MODULE_NOT_FOUND Cannot find module in ES modules

    Node can't find a file that is clearly there. What ES modules changed about relative imports, why TypeScript path aliases break at runtime, and what to change.

    > node:internal/modules/esm/resolve:275

    FIXED2 min
  40. No.012

    Fix: Unknown file extension ".ts" (ERR_UNKNOWN_FILE_EXTENSION)

    Node refuses to run your TypeScript file. The version where this stops happening, what ts-node has to do with it, and the one-line way to run .ts today.

    > node:internal/modules/esm/get_format:189

    FIXED3 min
  41. No.009

    Fix: Vite “Failed to resolve import” for @/ path aliases

    Vite can't resolve @/ imports: why the build can pass while the dev server and Vitest fail, and the configs that fix all three. Tested on Vite 8.3.5.

    > [vite] Internal server error: Failed to resolve import "@/utils/hello"

    FIXED4 min
  42. No.008

    Cannot apply unknown utility class border-border in Tailwind v4

    Three causes trigger this Tailwind v4 error, each with its own fix: custom colours, CSS modules and Vue/Svelte styles, and v3 classes. All reproduced.

    > Error: Cannot apply unknown utility class `border-border`

    FIXED3 min
  43. No.007

    Fix: npx tailwindcss init “could not determine executable to run”

    npx tailwindcss init fails on a fresh install. Why Tailwind v4 does this, two fixes that work, and the command that fails silently. Reproduced.

    > $ npx tailwindcss init

    FIXED2 min
  44. No.006

    Fix: npm ERESOLVE unable to resolve dependency tree (React 19)

    npm ERESOLVE with React 19 or ESLint 10, on npm 11 and 12. Four fixes compared, and why --legacy-peer-deps breaks the next npm ci.

    > npm error code ERESOLVE

    FIXED3 min
  45. No.005

    Fix: ERR_REQUIRE_ESM require() of ES Module not supported

    require() of an ES module: which Node versions throw ERR_REQUIRE_ESM (tested 20 to 26), the .default trap after upgrading, top-level await, and fixes.

    > Error [ERR_REQUIRE_ESM]: require() of ES Module ...\node_modules\chalk\source\index.js

    FIXED3 min
  46. No.004

    Fix: digital envelope routines::unsupported (ERR_OSSL_EVP_UNSUPPORTED)

    error:0308010C on webpack 4 and Create React App 4, tested on Node 16 to 26. Which fix works where: webpack 4.47.0, hashFunction, the legacy flag, CRA 5.

    > Error: error:0308010C:digital envelope routines::unsupported

    FIXED3 min
  47. No.003

    Windows 11 address already in use: 3 traps beyond taskkill

    Address already in use on Windows 11 (EADDRINUSE), but the PID is Docker, WSL or nothing at all. Reproduced: when not to kill it, and which port to pick.

    > node:events:486

    FIXED5 minWindows
  48. No.002

    Fix: require, __dirname not defined in ES module scope

    ReferenceError: require, __dirname or __filename is not defined in ES module scope. Why Node says it, and the fixes, tested on Node 24 and 26.

    > ReferenceError: __dirname is not defined in ES module scope

    FIXED3 min
  49. No.001

    Fix: “Cannot use import statement outside a module”

    Why Node, Jest, TypeScript output or your browser refuses import (or throws Unexpected token 'export'), and the fix for each. Tested on Node 20 to 26.

    > SyntaxError: Cannot use import statement outside a module

    FIXED6 min

Post card · Every Sunday

What broke this week.

One email on Sundays: the Node, TypeScript, Python and AI SDK releases that broke builds that week, each one reproduced, with a link to the fix that worked. Never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text