ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

ERR_MODULE_NOT_FOUND when building with TS, new in ipfs-core v0.18.0 #4323

Closed npfoss closed 1 year ago

npfoss commented 1 year ago

Severity: Medium?

Description:

Can't upgrade from v0.17.0 (builds and runs fine) to v0.18.0 of ipfs-core: tsc -b errors with

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'prom-client' imported from [...]/node_modules/@libp2p/prometheus-metrics/dist/src/index.js

Steps to reproduce the error:

typescript version: 4.9.5

code (simplified)

import { create as createIpfsNode, IPFS } from "ipfs-core";
const ipfs = createIpfsNode();

tsconfig.json (simplified)

{
  "display": "Node 16",
  "compilerOptions": {
    "lib": ["es2021", "dom"],
    "module": "ES2020",
    "target": "ES2015",
    "moduleResolution": "node",
}
whizzzkid commented 1 year ago

js-ipfs is being deprecated in favor of Helia. You can follow the migration plan here https://github.com/ipfs/js-ipfs/issues/4336 and read the migration guide.

Please feel to reopen with any comments before 2023-06-05. We will do a final pass on reopened issues afterward (see https://github.com/ipfs/js-ipfs/issues/4336).