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

express module not found when trying to run standalone server #36

Closed
RickyChan21 opened this issue Aug 26, 2022 · 2 comments
Closed

express module not found when trying to run standalone server #36

RickyChan21 opened this issue Aug 26, 2022 · 2 comments

Comments

@RickyChan21
Copy link

When trying to run the container after building it with the Dockerfile provided, I get the following error related to the express module:

> iqbit@1.0.1 server-docker-start /usr/src/node-app
> cd server && npm run serve:docker


> standalone-iqbit-server@1.0.0 serve:docker /usr/src/node-app/server
> node server.js

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module 'express'
Require stack:
- /usr/src/node-app/server/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/usr/src/node-app/server/server.js:1:17)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/src/node-app/server/server.js' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! standalone-iqbit-server@1.0.0 serve:docker: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the standalone-iqbit-server@1.0.0 serve:docker 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/2022-08-26T20_49_40_425Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iqbit@1.0.1 server-docker-start: `cd server && npm run serve:docker`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the iqbit@1.0.1 server-docker-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/2022-08-26T20_49_40_441Z-debug.log
@ntoporcov
Copy link
Owner

Sounds like we're missing a step to run "npm install" before those other commands.

You can try manually running it in the server folder if you nodejs installed

@RickyChan21
Copy link
Author

Thank you, it's working now after running "npm install express" on the server folder.

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

2 participants