免责声明:我对 node.js 一无所知,但我想在我的 ARMv7 NAS 上安装 vs code 远程开发。它包含节点,但失败了,提示“非法指令”。经过长时间的搜索,我终于让 NAS 从 src 编译节点。现在,当我运行这个新节点时,它会给我一种提示,而不是错误消息。到目前为止,一切都很好。
但后来我又回到了 vs code 及其脚本 (server.sh)。在告诉我几个问题后,它就停止了。我猜这与此有关:
Error: Module did not self-register: '/root/.vscode-server/bin/fe719cd3e5825bf14e14182fddeb88ee8daf044f/node_modules/spdlog/build/Release/spdlog.node'.
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
[...]
[23:58:40] getUnixShellEnvironment#errorChildProcess A system error occurred (spawn /bin/ash ENOENT)
[23:58:40] ptyHost was unable to resolve shell environment Error: Unable to resolve your shell environment: A system error occurred (spawn /bin/ash ENOENT)
at /root/.vscode-server/bin/fe719cd3e5825bf14e14182fddeb88ee8daf044f/out/vs/server/remoteExtensionHostAgent.js:85:58666
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /root/.vscode-server/bin/fe719cd3e5825bf14e14182fddeb88ee8daf044f/out/vs/server/remoteExtensionHostAgent.js:77:22250
[23:58:40] RequestService#request resolving shell environment failed Error: Unable to resolve your shell environment: A system error occurred (spawn /bin/ash ENOENT)
at /root/.vscode-server/bin/fe719cd3e5825bf14e14182fddeb88ee8daf044f/out/vs/server/remoteExtensionHostAgent.js:85:58666
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /root/.vscode-server/bin/fe719cd3e5825bf14e14182fddeb88ee8daf044f/out/vs/server/remoteExtensionHostAgent.js:77:22250
我不知道该怎么做。看到这些错误消息后,您该怎么做?
答案1
亲爱的大家和亲爱的@Daniel B
我删除了我的旧帖子,现在我想回答我自己的问题。感谢一位朋友,我发现问题在于 vs code 服务器自带了一些预编译的 node 模块。在这种情况下,它们是针对 node 版本 14 编译的。但我编译的是版本 16.(某某版本)。我不知道这是一个问题。从最新的 14.x 代码再次编译 node.js 后,模块现在可以正常工作了。如果将来有人可能遇到同样的问题,我想在这里添加这个。
祝你新年快乐!