timoschlueter / nightscout-librelink-up

Script written in TypeScript that uploads CGM readings from LibreLink Up to Nightscout.
MIT License
187 stars 247 forks source link

Local package.json exists, but node_modules missing, did you mean to install? #147

Open mstry9 opened 3 weeks ago

mstry9 commented 3 weeks ago

I've setup the NightScout in Google, https://navid200.github.io/xDrip/docs/Nightscout/GoogleCloud.html, and it works so I tried to install this and get this error. Maybe the setup from here doesn't support this?

Here's what I see when I run my start.sh

mstry9@instance-20240511-203125:~/main/nightscout-librelink-up-main$ sudo bash start.sh start.sh: line 2: rt: command not found

nightscout-librelink-up@2.6.1 start /home/mstry9/main/nightscout-librelink-up-main npx ts-node --transpile-only src/index.ts

npx: installed 17 in 2.185s Cannot find module 'typescript' Require stack:

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2024-06-15T00_12_23_032Z-debug.log mstry9@instance-20240511-203125:~/main/nightscout-librelink-up-main$

mstry9 commented 2 weeks ago

Not that anyone is even looking at this but here is the complete log: mstry9@instance-20240511-203125:~$ sudo cat /root/.npm/_logs/2024-06-15T00_12_23_032Z-debug.log 0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ] 2 info using npm@6.14.18 3 info using node@v14.21.3 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle nightscout-librelink-up@2.6.1~prestart: nightscout-librelink-up@2.6.1 6 info lifecycle nightscout-librelink-up@2.6.1~start: nightscout-librelink-up@2.6.1 7 verbose lifecycle nightscout-librelink-up@2.6.1~start: unsafe-perm in lifecycle true 8 verbose lifecycle nightscout-librelink-up@2.6.1~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/mstry9/main/nightscout-librelink-up-main/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin 9 verbose lifecycle nightscout-librelink-up@2.6.1~start: CWD: /home/mstry9/main/nightscout-librelink-up-main 10 silly lifecycle nightscout-librelink-up@2.6.1~start: Args: [ '-c', 'npx ts-node --transpile-only src/index.ts' ] 11 silly lifecycle nightscout-librelink-up@2.6.1~start: Returned: code: 1 signal: null 12 info lifecycle nightscout-librelink-up@2.6.1~start: Failed to exec start script 13 verbose stack Error: nightscout-librelink-up@2.6.1 start: npx ts-node --transpile-only src/index.ts 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:400:28) 13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:400:28) 13 verbose stack at maybeClose (internal/child_process.js:1088:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5) 14 verbose pkgid nightscout-librelink-up@2.6.1 15 verbose cwd /home/mstry9/main/nightscout-librelink-up-main 16 verbose Linux 5.15.0-1062-gcp 17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start" 18 verbose node v14.21.3 19 verbose npm v6.14.18 20 error code ELIFECYCLE 21 error errno 1 22 error nightscout-librelink-up@2.6.1 start: npx ts-node --transpile-only src/index.ts 22 error Exit status 1 23 error Failed at the nightscout-librelink-up@2.6.1 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

timoschlueter commented 2 weeks ago

from the logs it looks like you have to run 'npm install' before running the application. I never used Google Cloud but is there a step which lets you run the command before starting the application?

mstry9 commented 2 weeks ago

Thanks, that would probably work but this version of Ubuntu is so stripped down to keep the cost free it wouldn't install npm. I'll just keep using Shuggah as the uploader. Mostly just playing here anyway.

Sleepy46 commented 1 week ago

I also run Nightscout on Google Cloud but get a slightly different error

nightscout-librelink-up@2.6.1 start /home/martinlammers/nightscout-librelink-up-2.6.1
> npx ts-node --transpile-only src/index.ts

Unexpected token ?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nightscout-librelink-up@2.6.1 start: `npx ts-node --transpile-only src/index.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the nightscout-librelink-up@2.6.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/martinlammers/.npm/_logs/2024-06-26T19_36_59_154Z-debug.log

Or is this the same problem?