microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.46k stars 235 forks source link

Cannot find ../build/Debug/pty.node #497

Closed sayantan300 closed 2 years ago

sayantan300 commented 2 years ago

Environment details

Issue description

When Im requiring node-pty, it logs an error related to GCLIB. Reproduceable Code:


let pty;
try {
  pty = require('node-pty');
} catch (outerError) {
  console.error('outerError', outerError);
}

Note: Im not using any electron stuff. I just did a simple installation of node-pty.

Error Logs:

innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js
- /home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js
- /home/user/Desktop/discord-list/src/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._resolveFilename (/home/user/Desktop/discord-list/node_modules/module-alias/index.js:49:29)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js:30:15)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js:13:20)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/src/index.js:137:9)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js',
    '/home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js',
    '/home/user/Desktop/discord-list/src/index.js'
  ]
}
outerError Error: /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/Desktop/discord-list/node_modules/node-pty/build/Release/pty.node)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js:26:11)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js:13:20)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/src/index.js:137:9)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_DLOPEN_FAILED'
}

innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js
- /home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js
- /home/user/Desktop/discord-list/node_modules/gritty/server/gritty.js
- /home/user/Desktop/discord-list/src/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._resolveFilename (/home/user/Desktop/discord-list/node_modules/module-alias/index.js:49:29)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js:30:15)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js:13:20)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/gritty/server/gritty.js:11:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/src/index.js:146:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js',
    '/home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js',
    '/home/user/Desktop/discord-list/node_modules/gritty/server/gritty.js',
    '/home/user/Desktop/discord-list/src/index.js'
  ]
}
/home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js:35
        throw outerError;
        ^

Error: /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/Desktop/discord-list/node_modules/node-pty/build/Release/pty.node)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/unixTerminal.js:26:11)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/node-pty/lib/index.js:13:20)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/node_modules/gritty/server/gritty.js:11:13)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/user/Desktop/discord-list/src/index.js:146:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'ERR_DLOPEN_FAILED'
}
jerch commented 2 years ago

Imho there are several things not working here (also referring to https://github.com/microsoft/node-pty/issues/446#issuecomment-931942783):

sayantan300 commented 2 years ago

Thanks for the detailed explanation! Btw, will that fix if I download tar file from nodejs org and install it manually on my pc? Also I need to use nodejs v16 due to discordjs v13 needs nodejs v16, and v16 got some cool features that I was really looking for.

jerch commented 2 years ago

Using the tarball might be too much, as it would need you to build and install from sources. I suggest to use nvm, which can hold and switch between node versions easily.

Edit: I have not tried v16 yet with node-pty, but there are several issue reports, that it is not working out of the box due to changed native API.

sayantan300 commented 2 years ago

Yea, I thought that, that's why I had used snap. Well I was just installing nvm

Tyriar commented 2 years ago

duplicate of #438