"no exports" error when importing ts-core in nodejs project (using typescript)

I’m writing an application in typescript to run on nodejs. The following code:

import * as IPFS from 'ipfs-core';

results in an error

Error: No "exports" main defined in [...]/node_modules/ipfs-core/package.json

In tsconfig.json, I have "module": "commonjs". This article says to change that to esnext, but that doesn’t seem to work with nodejs.

How can I load ipfs-core in my nodejs project?