Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Type error: @libp2p/tcp not compatible with libp2p #194

Closed
eleijonmarck opened this issue Jul 24, 2022 · 1 comment
Closed

Type error: @libp2p/tcp not compatible with libp2p #194

eleijonmarck opened this issue Jul 24, 2022 · 1 comment

Comments

@eleijonmarck
Copy link

What happened:
I am following the getting started tutorial https://docs.libp2p.io/tutorials/getting-started/javascript/ to step Transports and getting a type error from a minimal example.

What is expected:
To be able to run the code without issues.

Reproduced minimal code example: https://stackblitz.com/edit/node-dsuzra?file=index.ts

import { createLibp2p } from 'libp2p';
import { TCP } from '@libp2p/tcp';

const main = async () => {
  const tcp = new TCP();
  const node = await createLibp2p({
    transports: [tcp],
  });
};

main();
// package.json
{
  "name": "node-starter",
  "version": "0.0.0",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "@libp2p/tcp": "^3.0.2",
    "libp2p": "^0.37.3",
    "typescript": "^4.7.4"
  }
}
@mpetrunic
Copy link
Member

This version of @libp2p/tcp is required for new version of libp2p. You can track progress here: libp2p/js-libp2p#1253

With libp2p@0.37.3, please use @libp2p/tcp@1.x

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants