denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
94.72k stars 5.26k forks source link

`deno install` issue with github package uWebSockets.js #25648

Closed birkskyum closed 2 weeks ago

birkskyum commented 3 weeks ago

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.
Malix-Labs commented 3 weeks ago

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

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

Malix-Labs commented 3 weeks ago

Also, porting uWS has already been dismissed : https://github.com/denoland/deno/issues/3366#event-3766347576

lucacasonato commented 3 weeks ago

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

Malix-Labs commented 3 weeks ago

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

bartlomieju commented 3 weeks ago

@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.

dsherret commented 3 weeks ago

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 commented 3 weeks ago

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

Opened a PR in deno_npm for this https://github.com/denoland/deno_npm/pull/69

birkskyum commented 2 weeks ago

This doesn't break anymore - awesome!

BolverBlitz commented 1 week ago

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 commented 1 week ago

@BolverBlitz I have opened a new issue for that: https://github.com/denoland/deno/issues/25956