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

deno install issue with github package uWebSockets.js #25648

Closed
birkskyum opened this issue Sep 15, 2024 · 10 comments
Closed

deno install issue with github package uWebSockets.js #25648

birkskyum opened this issue Sep 15, 2024 · 10 comments
Labels
bug Something isn't working correctly node compat

Comments

@birkskyum
Copy link
Contributor

birkskyum commented Sep 15, 2024

Version: deno 2.0.0-rc.2

https://github.com/unjs/crossws

Some projects use crossws, which use uWebSocksts, can't install, because uWebSockets.js isn't on npm, it's in here https://github.com/uNetworking/uWebSockets.js/

Affects anything that build on top of crossws, which is also everything build on vinxi:

Simple repro

Clone https://github.com/tanstack/tanstack.com
deno install (with deno 2.0 rc.2)

error: npm package 'uWebSockets.js' does not exist.
@birkskyum birkskyum changed the title Support crossws (it uses uWebSockets.js) Fix crossws installation (it uses uWebSockets.js) Sep 15, 2024
@birkskyum birkskyum changed the title Fix crossws installation (it uses uWebSockets.js) Fix crossws / uWebSockets.js installation Sep 15, 2024
@birkskyum birkskyum changed the title Fix crossws / uWebSockets.js installation Install error for: crossws / uWebSockets.js Sep 15, 2024
@birkskyum birkskyum changed the title Install error for: crossws / uWebSockets.js Installation issue with crossws / uWebSockets.js Sep 15, 2024
@littledivy littledivy added bug Something isn't working correctly node compat labels Sep 16, 2024
@Malix-Labs
Copy link

I tried extensively, and yep, that's not possible.

Check https://www.reddit.com/r/Deno/s/coZ5rsUwf0

@Malix-Labs
Copy link

Malix-Labs commented Sep 16, 2024

Also, porting uWS has already been dismissed : #3366 (comment)

@lucacasonato
Copy link
Member

You can install your dependencies with npm install - it supports NPM packages from GitHub.

@birkskyum birkskyum changed the title Installation issue with crossws / uWebSockets.js deno install issue with crossws / uWebSockets.js Sep 16, 2024
@Malix-Labs
Copy link

@lucacasonato uWebSocket doesn't want to be on any package manager

@bartlomieju
Copy link
Member

@lucacasonato uWebSocket doesn't want to be on any package manager

npm has ability to install from github: URLs as pointed by Luca. Deno can't do that at the moment.

@birkskyum birkskyum changed the title deno install issue with crossws / uWebSockets.js deno install issue with github package uWebSockets.js Sep 16, 2024
@dsherret
Copy link
Member

This package defines an optional peer dependency on "uWebSocket.js": "*" and only a dev dependency on "uWebSocket.js": "github:uNetworking/uWebSockets.js#v20.33.0" (https://registry.npmjs.org/crossws). If I install with npm it ignores the failure for the optional peer I believe. I think Deno just has to ignore optional peer deps when the package doesn't exist.

@nathanwhit
Copy link
Member

I think Deno just has to ignore optional peer deps when the package doesn't exist.

Opened a PR in deno_npm for this denoland/deno_npm#69

nathanwhit added a commit that referenced this issue Sep 24, 2024
Partially addresses #25648.

This allows packages that use `crossws` to be installed with `deno
install`. `crossws` specifies an optional peer dependency on
`uWebSockets`, but `uWebSockets` is not on npm (it is used with `git:`
or `github:` specifiers). Previously we would error on this, now we
don't error on non-existent optional peer dependencies.
@birkskyum
Copy link
Contributor Author

This doesn't break anymore - awesome!

@BolverBlitz
Copy link

So how do i get uWebsocket insalled on deno 2.0.0-rc.8 - If at all possible
I do not have any deno experience, just want to try it because nodeJS runs into strange GC issues under high load for that project.

Running deno install provides this message

deno install
error: Error in hyper-express@6.17.2 parsing version requirement for dependency "uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.48.0"

Caused by:
    Package specified a dependency outside of npm (github:uNetworking/uWebSockets.js#v20.48.0). Deno does not install these for security reasons. The npm package should be improved to have all its dependencies on npm.

    To work around this, you can use a package.json and install the dependencies via `npm install`.

But using npm install will install the build for nodeJs.
Resulting in the crash:

error: Uncaught (in promise) Error: This version of uWS.js supports only Node.js LTS versions 16, 18 and 20 on (glibc) Linux, macOS and Windows, on Tier 1 platforms (https://github.com/nodejs/node/blob/master/BUILDING.md#platform-list).

TypeError: LoadLibraryExW failed
    at file:///C:/Users/.../node_modules/uWebSockets.js/uws.js:22:9
    at Object.<anonymous> (file:///C:/Users/.../node_modules/uWebSockets.js/uws.js:24:3)
    at Object.<anonymous> (file:///C:/Users/.../node_modules/uWebSockets.js/uws.js:26:4)
    at Module._compile (node:module:748:34)
    at Object.Module._extensions..js (node:module:767:10)
    at Module.load (node:module:665:32)
    at Function.Module._load (node:module:537:12)
    at Module.require (node:module:684:19)
    at require (node:module:808:16)
    at Object.<anonymous> (file:///C:/Users/.../node_modules/hyper-express/index.js:4:21)```

@lucacasonato
Copy link
Member

@BolverBlitz I have opened a new issue for that: #25956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

No branches or pull requests

8 participants