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

can not run on centos 7.9 #298

Open
YHS2017 opened this issue Nov 5, 2024 · 13 comments
Open

can not run on centos 7.9 #298

YHS2017 opened this issue Nov 5, 2024 · 13 comments

Comments

@YHS2017
Copy link

YHS2017 commented Nov 5, 2024

[yhs@vbox server]$ npm run start

[email protected] start
ts-node index.ts

Error: Cannot find module '../../build/Release/node_datachannel.node'
Require stack:

  • /home/yhs/workspace/server/node_modules/node-datachannel/dist/cjs/lib/node-datachannel.cjs
  • /home/yhs/workspace/server/node_modules/node-datachannel/dist/cjs/lib/index.cjs
  • /home/yhs/workspace/server/rooms/lockstep.ts
  • /home/yhs/workspace/server/index.ts
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
    at Function.Module._load (node:internal/modules/cjs/loader:871:27)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object. (/home/yhs/workspace/server/node_modules/node-datachannel/src/lib/node-datachannel.ts:9:23)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32)
    at Function.Module._load (node:internal/modules/cjs/loader:909:12)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    [yhs@vbox server]$ cat /etc/redhat-release
    CentOS Linux release 7.9.2009 (Core)
    [yhs@vbox server]$ npm list
    [email protected] /home/yhs/workspace/server
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    ├── [email protected]
    └── [email protected]
@murat-dogan
Copy link
Owner

It can not find the addon binary.
Could you send also npm install command result?

This command normally should download the prebuilt binary from github. If it can not find it, it should try to compile.

@mirsella
Copy link

mirsella commented Nov 20, 2024

hello

im having the same problem with for a nitrojs server (for a nuxtapp, im using webtorrent, which use this plugin deep).
im on linux too, with node v23.1.0

[worker reload] [Error: [worker init] /home/mirsella/dev/nitro-app/.nitro/dev/index.mjs failed] {
  [cause]: Error: Cannot find module '../../build/Release/node_datachannel.node'
  Require stack:
  - /home/mirsella/dev/nitro-app/node_modules/.pnpm/[email protected]/node_modules/node-datachannel/dist/esm/lib/node-datachannel.mjs
      at Function._resolveFilename (node:internal/modules/cjs/loader:1246:15)
      at Function._load (node:internal/modules/cjs/loader:1072:27)
      at TracingChannel.traceSync (node:diagnostics_channel:322:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:216:24)
      at Module.require (node:internal/modules/cjs/loader:1337:12)
      at require (node:internal/modules/helpers:139:16)
      at file:///home/mirsella/dev/nitro-app/node_modules/.pnpm/[email protected]/node_modules/node-datachannel/dist/esm/lib/node-datachannel.mjs:13:21
      at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
      at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
      at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/home/mirsella/dev/nitro-app/node_modules/.pnpm/[email protected]/node_modules/node-datachannel/dist/esm/lib/node-datachannel.mjs'
    ]
  }
}

reproduction: https://github.com/mirsella/node-datachannel-nitro (pnpm i && pnpm dev) (same error with npm)

thanks

@mirsella
Copy link

i just tested with a empty deno project

import nodeDataChannel from "npm:node-datachannel";

nodeDataChannel.initLogger("Debug");

and error

Require stack:
- /home/mirsella/.cache/deno/npm/registry.npmjs.org/node-datachannel/0.20.0-alpha.2/dist/esm/lib/node-datachannel.mjs
    at Function.Module._resolveFilename (node:module:608:15)
    at Function.Module._load (node:module:486:27)
    at Module.require (node:module:674:19)
    at require (node:module:801:16)
    at file:///home/mirsella/.cache/deno/npm/registry.npmjs.org/node-datachannel/0.20.0-alpha.2/dist/esm/lib/node-datachannel.mjs:13:21

so its not just nitrojs

@murat-dogan
Copy link
Owner

Thank you for your notes.
I don't have a Centos. But probably it is related to the GLIBC version.

Can node 23 run on Centos 7?
I am asking while v7 is old.

If I download a VM here, can I install node 23 and regenerate the issue? Or do I need some other modifications?

https://www.linuxvmimages.com/images/centos-7/

@mirsella
Copy link

for my it's on archlinux, so far from CentOS

@murat-dogan
Copy link
Owner

I am on Ubuntu 22.04 and I have tested your repo.
No problem for me.
I have tried with node v20 and v23.

Do you see this file in place build/Release/node_datachannel.node?
Which version arch are you using and how I can re-generate it?

@mirsella
Copy link

thanks for the answer.

arch doesn't have release, so hard to get the exact version. I'll try to do a VM with a clean arch install to test.

the file is there in node module

@mirsella
Copy link

mirsella commented Nov 21, 2024

docker run -it --name arch archlinux sh
pacman -Sy git nodejs npm
git clone https://github.com/mirsella/node-datachannel-nitro
cd node-datachannel-nitro
npm i
npm run dev

then we just have to trigger the route hot reload in another shell:
docker exec -it arch sh -c 'echo "" >> node-datachannel-nitro/server/routes/index.ts'

thanks

@murat-dogan
Copy link
Owner

In my case there was no error
Here is console output;

[root@0e9c2546b4cd app]# npm i
(node:167) ExperimentalWarning: CommonJS module /usr/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /usr/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.

> prepare
> nitro prepare


added 564 packages, and audited 566 packages in 15s

117 packages are looking for funding
  run `npm fund` for details

6 high severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
[root@0e9c2546b4cd app]# npm run dev

> dev
> nitro dev


  ➜ Local:    http://localhost:3000/
  ➜ Network:  use --host to expose

✔ Nitro Server built in 305 ms                                                                                                                    nitro 7:18:35 PM

What is the difference?

@mirsella
Copy link

thanks for testing

did you run in another terminal the other command I gave to trigger nitro hot modules reload ?

I'll do a quick screen record to exactly demo the problem.

thanks

@murat-dogan
Copy link
Owner

I have exactly these commands run.
#298 (comment)

except github clone, I have for easy working create a volume for the app folder

@murat-dogan
Copy link
Owner

murat-dogan commented Nov 22, 2024

Ooops sorry. Now I undestood your point.
And got the same error.

Testing more.

But I can definitely say that this is not related to
#298 (comment)

Maybe it is better to create another issue

@murat-dogan
Copy link
Owner

Please follow here
#310

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