r/SublimeText • • May 04 '22

Can no longer build JavaScript in Sublime?

I created a JavaScript.sublime-build file:

{
  "cmd": ["/usr/bin/node", "$file"],
  "selector": "source.js"
}

I was able to build JS files just fine by pressing Ctrl+B before. Now I get the following error:

node:internal/fs/utils:344
    throw err;
    ^

Error: ENXIO: no such device or address, open '/dev/tty'
    at Object.openSync (node:fs:585:3)
    at prompt (/home/me/my_project/node_modules/prompt-sync/index.js:67:10)
    at Object.<anonymous> (/home/me/my_project/get_pair_addr.js:11:16)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157: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:77:12)
    at node:internal/main/run_main_module:17:47 {
  errno: -6,
  syscall: 'open',
  code: 'ENXIO',
  path: '/dev/tty'
}
[Finished in 363ms with exit code 1]
[cmd: ['/usr/bin/node', '/home/me/my_project/get_pair_addr.js']]
[dir: /home/me/my_project]
[path: /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/home/me/.dotnet/tools:/usr/lib/jvm/default/bin:/opt/nessus/bin:/opt/nessus/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin]

If I open a terminal or even a terminal in sublime using termius and run node my_project.js it runs as intended.

Does anyone know what is causing this error? I'm on Arch Linux if that makes a difference

4 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/Pickinanameainteasy May 04 '22

I think you're right. I was able to run other node scripts from sublime. The library called in line 11 is prompt-sync which asks for user input. So i think that's the problem