No "exports" main defined

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No “exports” main defined in /Users/santi/code/ipfs-example/node_modules/ipfs-http-client/package.json

getting the following error when i run my node app.js
my node version is 16.14.2
the commands i ran were before were
npm init -y
npm i ipfs-http-client

below is my app.js code

const { create } = require("ipfs-http-client");

async function ipfsClient() {
    const ipfs = await create(
        {
            host: "ipfs.infura.io",
            port: 5001,
            protocol: "https"
        }
    );
    return ipfs;
}

async function saveText() {
    let ipfs = await ipfsClient();

    let result = await ipfs.add("hello");

    console.log(result);
}
saveText();

i am following this tutorial
ill attach also the git
here is the git

The author seems to recommend removing package-lock.json: problem in the " npm i ipfs-http-client "package it showing 'ERR_PACKAGE_PATH_NOT_EXPORTED' · Issue #1 · adityajoshi12/ipfs-example · GitHub

1 Like