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

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

Open
mstry9 opened this issue Jun 15, 2024 · 5 comments

Comments

@mstry9
Copy link

mstry9 commented Jun 15, 2024

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

[email protected] 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:

  • /root/.npm/_npx/12539/lib/node_modules/ts-node/dist/util.js
  • /root/.npm/_npx/12539/lib/node_modules/ts-node/dist/bin.js
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] start: npx ts-node --transpile-only src/index.ts
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?

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
Copy link
Author

mstry9 commented Jun 23, 2024

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 [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]
prestart: [email protected]
6 info lifecycle [email protected]start: [email protected]
7 verbose lifecycle [email protected]
start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]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 [email protected]
start: CWD: /home/mstry9/main/nightscout-librelink-up-main
10 silly lifecycle [email protected]start: Args: [ '-c', 'npx ts-node --transpile-only src/index.ts' ]
11 silly lifecycle [email protected]
start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] start: npx ts-node --transpile-only src/index.ts
22 error Exit status 1
23 error Failed at the [email protected] 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
Copy link
Owner

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
Copy link
Author

mstry9 commented Jun 23, 2024

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
Copy link

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

[email protected] 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! [email protected] start: `npx ts-node --transpile-only src/index.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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?

@mstry9
Copy link
Author

mstry9 commented Dec 17, 2024

Ended up deploying this as a stand alone service in northflank. Seems to be working fine uploading to my Google Nightscout

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

3 participants