Node.js 12 introduced support for the import statement behind a --experimental-modules flag and a package.json configuration option.Node.js 14 removes the need for the --experimental-modules flag, but you still need to configure your package.json.Here's how you can use ES6 imports in Node. and change your code to this You can use ES6 import/export in Node.js by simply adding type: module to your package.json file, like this: { "type": "module" } You can also save a file with the .mjs extension to be able to use import/export, for example: // abc.mjs const abc = => { console.log('hello') } export default abc; Promise based HTTP client for the browser and node.js - GitHub - axios/axios: Promise based HTTP client for the browser and node.js ArrayBufferView, URLSearchParams // - Browser only: FormData, File, Blob // - Node only: Stream, Buffer, FormData (form-data package) axios depends on a native ES6 Promise implementation to be supported. I'm trying to run ES6 modules natively on the browser (