Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Can't resolve 'uws' in 'C:\....\node_modules\engine.io\lib #3342

Closed
1 of 2 tasks
walkerreynolds16 opened this issue Oct 2, 2018 · 10 comments
Closed
1 of 2 tasks

Comments

@walkerreynolds16
Copy link

Note: for support questions, please use one of these channels: stackoverflow or slack

For bug reports and feature requests for the Swift client, please open an issue there.

For bug reports and feature requests for the Java client, please open an issue there.

You want to:

  • report a bug
  • request a feature

Current behaviour

What is actually happening?
When ever I try to require socket io into any project and run it, I always get a module not found for UWS. If tried to manually install uws and ws but I get the same behavior.

Steps to reproduce (if the current behaviour is a bug)

npm install socket.io --save

add 'var io = require('socket.io')();' to app.js

npm run start

fails to build

Note: the best way (and by that we mean the only way) to get a quick answer is to provide a failing test case by forking the following fiddle.

Expected behaviour

What is expected?

Socket.io compiling

Setup

  • OS: Windows 10
  • browser: Chrome
  • socket.io version: 2.1.1

Other information (e.g. stacktraces, related issues, suggestions how to fix)

./node_modules/engine.io/lib/server.js
Module not found: Can't resolve 'uws' in 'C:\Users\Walker\Desktop\Test\sockettest\node_modules\engine.io\lib'

@kfarst
Copy link

kfarst commented Oct 16, 2018

I believe this is happening because the uws package is in the devDependencies instead of dependencies in the package.json

@mhpm
Copy link

mhpm commented Nov 15, 2018

i have de same problem, please help

@makhnnar
Copy link

I have the same problem too

@makhnnar
Copy link

i'm using linux lubuntu 16.04

@makhnnar
Copy link

i found an answer in https://stackoverflow.com/questions/52616766/socket-io-module-not-found-cant-resolve-uws-in-c-node-modules-engine

i used this and works

import openSocket from 'socket.io-client';

const socket = openSocket(myURL);

@codymikol
Copy link

So I just had this same issue, but for a very different reason. Currently when I install the latest socket.io server package from npm uws will not be found.

This is happening because the publisher of uws has recently uploaded an empty package deleting all of the actual code D:

You can fix this by installing the last non destroyed release

yarn add uws@10.148.1
npm install uws@10.148.1

Link to empty / deprecated package: https://www.npmjs.com/package/uws

Insightful background info from reddit: https://www.reddit.com/r/node/comments/91kgte/uws_has_been_deprecated/

I'm going to post this in the top few results that come up when searching for this issue as it took me a while to figure out what was up and hopefully this will save someone out there some time!

@kjr247
Copy link

kjr247 commented Apr 17, 2019

@makhnnar seems to be my solution as well! And actually it is stated in the docs right near the top of the page.

import openSocket from 'socket.io-client';

const socket = openSocket(myURL);

@Femina
Copy link

Femina commented Dec 8, 2019

Yes, I am facing exactly the same issue. But. I wanna use socket.io instead of client, Any thoughts? How to fix?

@vishalj20
Copy link

You can fix this by installing the last non destroyed release

yarn add uws@10.148.1
npm install uws@10.148.1

@darrachequesne
Copy link
Member

For future readers:

ws was reverted as the default wsEngine in socket.io@2.1.0, as there was a lot of stability issues with "uws".

Documentation: https://socket.io/docs/v3/server-installation/

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

No branches or pull requests

9 participants