burnedikt / diasend-nightscout-bridge

Synchronize your diasend data to nightscout.
MIT License
18 stars 18 forks source link

Cannot find module '/usr/local/app/dist/run.js' #48

Closed AndyLow91 closed 1 year ago

AndyLow91 commented 1 year ago

I've followed the instructions for running this package via docker as a standalone/sidecar uploader an running into the following problem:

Node.js v18.15.0
node:internal/modules/cjs/loader:1078
  throw err;
  ^

Error: Cannot find module '/usr/local/app/dist/run.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I'm not 100% familiar with npm but I believe there is a dependency missing?

**Steps that I followed: copied this repo to my machine with git clone. created a .env file with the variables required run docker build -t diasend2nightscout . to build the image created a docker-compose.yml file:

version: '3'
services:
  diasend-bridge:
    image: diasend2nightscout
    environment:
      DIASEND_USERNAME: ${DIASEND_USERNAME}
      DIASEND_PASSWORD: ${DIASEND_PASSWORD}
      NIGHTSCOUT_URL: ${NIGHTSCOUT_URL}
      NIGHTSCOUT_API_SECRET: ${NIGHTSCOUT_API_SECRET}
    restart: always

ran docker compose up -d.

Thanks

burnedikt commented 1 year ago

Hey, I haven't lately tried the deployment using docker but just to double-Check: I assume you built the docker image prior to running docker compose up?

AndyLow91 commented 1 year ago

Yeah, I ran the command:

docker build -t diasend2nightscout .

then once the build was completed, ran:

docker compose up -d

It would be good to use the Nightscout version of this project, Are there plans to integrate it with the core version of Nightscout?

burnedikt commented 1 year ago

It would be good to use the Nightscout version of this project, Are there plans to integrate it with the core version of Nightscout?

There are plans indeed but no action in the last two months by the maintainers: https://github.com/nightscout/cgm-remote-monitor/pull/7872

burnedikt commented 1 year ago

I found some time today to reproduce this issue. Indeed, the Dockerfile had an error and tried to run scripts in a location where they no longer existed. Fixed with this commit: https://github.com/burnedikt/diasend-nightscout-bridge/commit/3ebf723099bb2b585544d863b491f213a7b978fa.

You should be able to just pull the latest changes and rebuild the image.

Sorry for the inconvenience!

AndyLow91 commented 1 year ago

Incredible! Thanks for the quick resolution and it works like a charm now =)