question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conflicting @types/node version

See original GitHub issue

Describe the bug There is fixed version of node types defined as socket.io dependency causing conflicts. https://github.com/socketio/socket.io/blob/12221f296d52b3dcde34246bd1ada98871b4ada3/package.json#L48

To Reproduce

  • install other version of @types/node as your dev dependency of your project (e.g. @types/node@12)
  • install socket.io@3 as original dependency of your project
  • try to compile typescript file, you will get the following error:
node_modules/socket.io/dist/client.d.ts:1:23 - error TS4090: Conflicting definitions for 'node' found at
'~/example_project/node_modules/socket.io/node_modules/@types/node/index.d.ts' and
'~/example_project/node_modules/@types/node/index.d.ts'.
Consider installing a specific version of this library to resolve the conflict.

1 /// <reference types="node" />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Sumolaricommented, Feb 15, 2021

Btw. doesn’t it make sense to have that and other @types defined as dependencies (non-dev)?

I was about to open a different issue about moving @types/node to devDependencies. It’s a big package (around 740kb) and it should give no value on runtime.

2reactions
andrejleitnercommented, Feb 15, 2021

Hey @ironicbrew, thanks for looking at it. Before posting it here, I’ve tried a clean installation exactly as you suggested. It just didn’t help. Btw. doesn’t it make sense to have that and other @types defined as dependencies (non-dev)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve 'Conflicting definitions for node' TS4090 error in VS ...
My theory is, Visual Studio automatically included types for accessible version of node, as a part of linting functionality for JavaScript. But ...
Read more >
Conflicting Type Dependencies - ember-cli-typescript
So now you have two versions of C installed in your node_modules directory: 1.2.3 (for B ) and 1.2.4 (for A , your...
Read more >
Node Version Conflicts - Square 9 Documentation Hub
To check the installed version of Node.JS, open a command prompt by opening the start menu and typing "cmd". In the command prompt...
Read more >
@types/node - npm
TypeScript definitions for Node.js. Latest version: 18.11.17, last published: 8 days ago. Start using @types/node in your project by running ...
Read more >
Surviving the TypeScript Ecosystem — Part 4 - Medium
So if the types for node are not available when using the types for ... of my library conflict, or are slightly different,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found