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

I error MODULE_NOT_FOUND when I try to start rpos in docker? #133

Open
lpt2007 opened this issue Mar 27, 2022 · 0 comments
Open

I error MODULE_NOT_FOUND when I try to start rpos in docker? #133

lpt2007 opened this issue Mar 27, 2022 · 0 comments

Comments

@lpt2007
Copy link

lpt2007 commented Mar 27, 2022

dockerfile:


FROM ghcr.io/home-assistant/armhf-base-raspbian:bullseye

# Install requirements for add-on
RUN apt-get update && apt-get install -y \
    nodejs \
    npm \
    liblivemedia-dev \
    liblivemedia-dev \
    liblog4cpp5-dev \
    cmake \
    libasound2-dev \
    v4l-utils
    
# So let's set it to our add-on persistent data directory.
WORKDIR /data

# install onvif server
# install npm and node.js (latest 17 in 26.3.22)
RUN npm install -g n \
    && n install 17
RUN git clone https://github.com/BreeeZe/rpos.git \
    && cd rpos \
    && npm install
    
# So let's set it to our add-on persistent data/rpos directory.
WORKDIR /data/rpos 

RUN npx gulp
#RUN npm install -g gulp
#RUN npm install gulp
#    && sh setup_v4l2rtspserver.sh
    
# instal v4l2rtspserver
RUN git clone https://github.com/mpromonet/v4l2rtspserver.git \
    && cd v4l2rtspserver/ \
    && cmake . \
    && make \
    && make install

# Copy data for add-on
COPY rposConfig.json /data/rpos/
COPY run.sh /
RUN chmod a+x /run.sh

CMD ["/bin/sh","/run.sh"]

run.sh file:

#!/usr/bin/with-contenv bashio

echo "ONVIF server started"
cd /data/rpos
echo "go to directory /data/rpos"
/usr/local/bin/node /data/rpos/rpos.js

ERROR:

node:internal/modules/cjs/loader:936
  throw err;
  ^
Error: Cannot find module '/data/rpos/rpos.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Node.js v17.8.0

When I run image mannualy using command:
docker run --rm -it --device /dev/video0 -p 8554:8554 --entrypoint bash image-name
and run command, rpos starts normaly without error:
/bin/sh /run.sh

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

1 participant