【发布时间】:2021-06-29 07:45:08
【问题描述】:
我的操作系统是 windows。我想使用 xterm 和 node-pty 创建一个 bash shell。有这行代码:
this.shell = os.platform() === 'win32' ? 'powershell.exe' : 'bash';
终端在浏览器中呈现的方式。现在假设如果我写:
this.shell = os.platform() === 'win32' ? 'bash' : 'powershell.exe';
或者
this.shell = os.platform() === 'linux' ? 'powershell.exe' : 'bash';
为什么不渲染 bash shell。它给了我这个错误:
D:\DE_proj\linuxterminal\server\node_modules\node-pty\lib\windowsPtyAgent.js:75
term = this._ptyNative.startProcess(file, cols, rows, debug, this._generatePipeName(), conptyInheritCursor);
^
Error: File not found:
at new WindowsPtyAgent (D:\DE_proj\linuxterminal\server\node_modules\node-pty\lib\windowsPtyAgent.js:75:36)
at new WindowsTerminal (D:\DE_proj\linuxterminal\server\node_modules\node-pty\lib\windowsTerminal.js:50:24)
at Object.spawn (D:\DE_proj\linuxterminal\server\node_modules\node-pty\lib\index.js:28:12)
at PTY.startPtyProcess (D:\DE_proj\linuxterminal\server\PTYService.js:16:27)
at new PTY (D:\DE_proj\linuxterminal\server\PTYService.js:11:10)
at Namespace.<anonymous> (D:\DE_proj\linuxterminal\server\SocketService.js:40:18)
at Namespace.emit (events.js:315:20)
at Namespace.emitReserved (D:\DE_proj\linuxterminal\server\node_modules\socket.io\dist\typed-events.js:56:22)
at D:\DE_proj\linuxterminal\server\node_modules\socket.io\dist\namespace.js:140:26
at processTicksAndRejections (internal/process/task_queues.js:75:11)
[nodemon] app crashed - waiting for file changes before starting...
抱歉问题中的任何错误我对此很陌生...
【问题讨论】:
-
您似乎在 Windows 上,并且您似乎没有安装 Bash,或者至少没有在您的
PATH中。还有什么要解释的?
标签: bash shell xtermjs node-pty