Error code

Node.js ERR_UNKNOWN_FILE_EXTENSION

NODE.JSERR_UNKNOWN_FILE_EXTENSION
Runtime Error Code· An error code from a programming runtime or package manager, like Node.js or npm.

What it means

Node.js does not recognize the file extension when loading a module.

How to fix it

  1. Add a custom loader with --experimental-loader.
  2. Rename the file to a supported extension.
  3. Configure a bundler or transpiler to preprocess the file before Node.js loads it.

Not affiliated with Node.js. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.