【问题标题】:unix ssh find node.js fileunix ssh 查找 node.js 文件
【发布时间】:2013-08-16 18:56:26
【问题描述】:

使用 ssh 怎么在我的服务器上找不到这个文件?

找到 . -name lib/child_process.js

我知道它在那里,因为我正在使用它并且可以看到错误:

net.js:1054
if (port && handle.getsockname && port != handle.getsockname().port) {
                  ^
TypeError: Cannot read property 'getsockname' of undefined
at net.js:1054:23
at Object.1:1 (cluster.js:587:5)
at handleResponse (cluster.js:171:41)
at respond (cluster.js:192:5)
at handleMessage (cluster.js:202:5)
at process.EventEmitter.emit (events.js:117:20)
at handleMessage (child_process.js:318:10)
at child_process.js:387:7
at process.handleConversion.net.Native.got (child_process.js:91:7)
at process.<anonymous> (child_process.js:386:13)

child_process.js:387:7

如果有人知道如何查找/取消隐藏,我想查找并编辑(nano 文件名)这个 js 文件?

在此修复后:https://github.com/bnoordhuis/node/commit/1dacde5a7d0c0363e811101d10140133c8245fbe

【问题讨论】:

  • 为什么在你的 find 命令中使用lib/foo?那是极不可能找到任何东西的。只需提供文件名即可。
  • 不,它一直在我的 facebook-chat 节点模块(依赖项)中找到同名的文件
  • 没有别的了?会不会是 node.js 中的“内置”文件,而实际上并不存在于您的文件系统中(“编译”-in 或某种存档)?
  • 好吧,上面的错误代码说这是一个过程,所以你很可能是对的...... git 用户是如何在这里编辑代码的:github.com/bnoordhuis/node/commit/…
  • 补丁通常适用于源代码树,而不是已安装的应用程序。从源代码生成 node.js 可能有“打包”步骤。 (我不熟悉,这只是猜测。)

标签: node.js file unix ssh


【解决方案1】:

作为记录,issue 5330issue 5774 可能会引起人们的兴趣。

但是,child_processCore Module,实际上是作为 node 可执行文件的一部分编译的。

Node 有几个模块编译成二进制文件。 [...]

核心模块在 lib/ 文件夹的节点源代码中定义。

如果您想应用编辑,您需要一份源代码副本(来自GitHubdistribution)来修补、编译和安装。

Node 的 Installation Guide 可能值得一试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-17
    • 1970-01-01
    • 1970-01-01
    • 2013-02-07
    • 2023-03-10
    相关资源
    最近更新 更多