When I import it into a Typescript project, the build fails with the following error.
const public_ip_1 = __importDefault(require("public-ip"));
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/public-ip/index.js from /app/dist/index.js not supported.
Instead change the require of /app/node_modules/public-ip/index.js in /app/dist/index.js to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/app/dist/index.js:13:37) {
code: 'ERR_REQUIRE_ESM'
}
Node.js v17.6.0
When I import it into a Typescript project, the build fails with the following error.
Build command:
tsc build && node dist/
.