Johni0702 / mumble-web

An HTML5 Mumble client
682 stars 151 forks source link

Cannot install webrtc branch #111

Closed asmaps closed 4 years ago

asmaps commented 4 years ago

I'm trying to set up the webrtc version but the building always fails. npm run build quits with this error:

ERROR in ./node_modules/mumble-client/index.js
Module not found: Error: Can't resolve './lib/client.js' in '/opt/mumble-web/node_modules/mumble-client'
 @ ./node_modules/mumble-client/index.js 1:17-43
 @ ./app/index.js
 @ multi ./app/index.js ./app/index.html

ERROR in ./node_modules/mumble-client-websocket/index.js
Module not found: Error: Can't resolve './lib/index.js' in '/opt/mumble-web/node_modules/mumble-client-websocket'
 @ ./node_modules/mumble-client-websocket/index.js 1:17-42
 @ ./app/index.js
 @ multi ./app/index.js ./app/index.html

I don't know the packaging mechanisms in npm too well, but it seems like it clones the mumble-client repo but doesn't build it, hence the lib directory doesn't exist.

Am I doing something wrong or is this a bug?

Building with this Dockerfile:

FROM node:14.2-stretch

USER root
RUN apt-get update && apt-get install -y libnice-dev clang
ADD rustup.sh /opt
RUN /opt/rustup.sh -y
WORKDIR /opt
RUN git clone https://github.com/Johni0702/mumble-web-proxy && cd mumble-web-proxy && git checkout 2a95f11d304d20dca0741ebc9fbc5502fbbf4acb

WORKDIR /opt/mumble-web-proxy
RUN /root/.cargo/bin/cargo build --release

WORKDIR /opt
RUN git clone -b webrtc https://github.com/Johni0702/mumble-web && cd mumble-web && git checkout 456a2fcf8c019e6281e0ded41aaab4e5576e1222
WORKDIR /opt/mumble-web
RUN npm install
RUN npm run build
VOLUME ["/opt/mumble-web"]

USER 1000
CMD ["/opt/mumble-web-proxy/target/release/mumble-web-proxy", "--listen-ws", "64737", "--server", "mumble:64738"]

Also tried installing and building with yarn, but didn't change anything.

streaps commented 4 years ago

don't build as root.

Johni0702 commented 4 years ago

Yup, npm behaves different when running as root. In particular it won't run any scripts (most of the time) hence why the mumble-client repo was only cloned but not built.