TypeError[ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension “.json” – How to fix ?
Since ES6 when you try to import JSON file you might face this error.
node distance-calculator.js node:internal/errors:464 ErrorCaptureStackTrace(err); ^ TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".json" for /home/Anand/Documents/poopatom8/zips.json
To fix this error simple add the flag –experimental-json-modules to your node.js run command.
node --experimental-json-modules distance-calculator.js