#Discord Bot and Website Problem | CloudFlare/GoDaddy/Oracle

26 messages · Page 1 of 1 (latest)

undone acorn
#

When I try to launch it with sudo npm start I got this :

> [email protected] start
> node frontend/index.js

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

Error: Cannot find module 'node:events'
Require stack:
- /home/ubuntu/JaJS-Bot/node_modules/express/lib/express.js
- /home/ubuntu/JaJS-Bot/node_modules/express/index.js
- /home/ubuntu/JaJS-Bot/frontend/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:85:18)
    at Object.<anonymous> (/home/ubuntu/JaJS-Bot/node_modules/express/lib/express.js:16:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/ubuntu/JaJS-Bot/node_modules/express/lib/express.js',
    '/home/ubuntu/JaJS-Bot/node_modules/express/index.js',
    '/home/ubuntu/JaJS-Bot/frontend/index.js'
  ]
}```
#

So now I ask for help, I don't know what to do, and how to deploy my bot and website to public. All my code is on the GitHub link and I launch index.js in frontend/ folder.

#

I also planned to use pm2 but if someone have some better idea it would be awesome.

narrow sage
#

My guess is that the root user has a really old version of Node.js

undone acorn
# narrow sage My guess is that the root user has a really old version of Node.js
> node frontend/index.js

node:events:496
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES: permission denied 0.0.0.0:443
    at Server.setupListenHandle [as _listen2] (node:net:1915:21)
    at listenInCluster (node:net:1994:12)
    at Server.listen (node:net:2099:7)
    at Object.<anonymous> (/home/ubuntu/JaJS-Bot/frontend/index.js:26:40)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32)
    at Function._load (node:internal/modules/cjs/loader:1108:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
Emitted 'error' event on Server instance at:
    at emitErrorNT (node:net:1973:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {
  code: 'EACCES',
  errno: -13,
  syscall: 'listen',
  address: '0.0.0.0',
  port: 443
}

Node.js v22.14.0```

That's without sudo before npm start
narrow sage
#

What’s the output

undone acorn
narrow sage
#

sudo node -v sudo npm -v

undone acorn
narrow sage
#

You need to update your versions

undone acorn
#

Because I updated it already but on the sudo node et sudo npm it's not updated

untold belfry
#

ubuntu's node version on apt is terribly out of date

#

There's a community managed apt repo that you can fetch from, or install a version manager, or run it as a docker container.

undone acorn
untold belfry
#

I forget the specifics of each method for ubuntu, sorry

undone acorn
#

Not a problem thanks

solar cipher
narrow sage
#

(Note that, while maintained by a Node.js collaborator, NodeSource is not an officially endorsed download method)

solar cipher
#

-# I wish it was. it's so darn handy...

untold belfry
#

afaik the way to it would be to have someone do the maintenance on the nodejs in the repos but ain't nobody got time for that

narrow sage
#

It’s actually for a different reason. We don’t display any apt packages on the site

#

an installation method claiming compatibility with “Linux” must be installable on all major Linux distributions, not just a specific subset. It cannot rely on distribution-specific package managers like apt or dnf.