Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在web worker中使用nodejs ssh2_Node.js_Multithreading_Worker_Ssh2_Node Worker Threads - Fatal编程技术网

Node.js 在web worker中使用nodejs ssh2

Node.js 在web worker中使用nodejs ssh2,node.js,multithreading,worker,ssh2,node-worker-threads,Node.js,Multithreading,Worker,Ssh2,Node Worker Threads,我正在尝试使用nodejsapi中的一个nx项目(使用@nrwl/node)中的ssh2插件 这是我的模块: export const datasetranfermodule=({username,password})=>{ 变量设置={ 主持人:“192.168.1.14”, 港口:22, 用户名, 密码 //您也可以使用密钥文件,请阅读ssh2文档 }; var SSHClient=要求(“ssh2”)。客户; //用SSHClient做点什么 返回; }; 通过更改默认网页包行为,我无法

我正在尝试使用nodejsapi中的一个nx项目(使用
@nrwl/node
)中的ssh2插件

这是我的模块:

export const datasetranfermodule=({username,password})=>{
变量设置={
主持人:“192.168.1.14”,
港口:22,
用户名,
密码
//您也可以使用密钥文件,请阅读ssh2文档
};
var SSHClient=要求(“ssh2”)。客户;
//用SSHClient做点什么
返回;
};
通过更改默认网页包行为,我无法使其正常工作:

module.exports=(配置,上下文)=>{
const WorkerPlugin=require('worker-plugin')
返回{
…配置,
节点:{
过程:正确,
全球:真的
},
插件:[
新工人公寓({
插件:[
//此处的字符串将从您的配置中复制命名插件:
‘ssh2’,
//或者您可以直接指定插件,仅应用于工作代码:
]
})
]
};
};
在一个工人内这样做可以吗?如果是这样,如何从worker导入ssh