-1
나는 클러스터로 ssh를하고 스파크 코드를 실행해야한다. 이 작업은 브라우저에서 수행해야합니다. Reactjs를 사용하여 UI를 만들고 'ssh2'를 사용하여 NPM에서 클러스터에 액세스합니다. 다음 코드를 사용할 때.nsh의 ssh2 모듈을 가져온 후의 오류
var Client = require('ssh2').Client;
은 내가 follwing을 경고 및 오류 메시지가 표시됩니다.
WARNING in ./node_modules/defaultable/defaultable.js
49:13-31 Critical dependency: the request of a dependency is an expression
@ ./node_modules/defaultable/defaultable.js
@ ./node_modules/hbo-dnsd/server.js
@ ./node_modules/hbo-dnsd/named.js
@ ./node_modules/dns/lib/dns.js
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/ssh2/lib/agent.js
Module not found: Error: Can't resolve 'child_process' in '/Users/byra/Work/reactTest/node_modules/ssh2/lib'
@ ./node_modules/ssh2/lib/agent.js 6:9-33
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/native-dns-cache/lookup.js
Module not found: Error: Can't resolve 'dgram' in '/Users/byra/Work/reactTest/node_modules/native-dns-cache'
@ ./node_modules/native-dns-cache/lookup.js 21:12-28
@ ./node_modules/native-dns-cache/index.js
@ ./node_modules/native-dns/lib/platform.js
@ ./node_modules/native-dns/dns.js
@ ./node_modules/dns/lib/dns.js
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/native-dns/lib/server.js
Module not found: Error: Can't resolve 'dgram' in '/Users/byra/Work/reactTest/node_modules/native-dns/lib'
@ ./node_modules/native-dns/lib/server.js 23:12-28
@ ./node_modules/native-dns/dns.js
@ ./node_modules/dns/lib/dns.js
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/native-dns/lib/utils.js
Module not found: Error: Can't resolve 'dgram' in '/Users/byra/Work/reactTest/node_modules/native-dns/lib'
@ ./node_modules/native-dns/lib/utils.js 21:12-28
@ ./node_modules/native-dns/lib/server.js
@ ./node_modules/native-dns/dns.js
@ ./node_modules/dns/lib/dns.js
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/native-dns/lib/platform.js
Module not found: Error: Can't resolve 'fs' in '/Users/byra/Work/reactTest/node_modules/native-dns/lib'
@ ./node_modules/native-dns/lib/platform.js 23:9-22
@ ./node_modules/native-dns/dns.js
@ ./node_modules/dns/lib/dns.js
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '/Users/byra/Work/reactTest/node_modules/request/lib'
@ ./node_modules/request/lib/har.js 3:9-22
@ ./node_modules/request/request.js
@ ./node_modules/request/index.js
@ ./node_modules/webhdfs/lib/webhdfs.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/ssh2-streams/lib/sftp.js
Module not found: Error: Can't resolve 'fs' in '/Users/byra/Work/reactTest/node_modules/ssh2-streams/lib'
@ ./node_modules/ssh2-streams/lib/sftp.js 6:16-29 11:9-22
@ ./node_modules/ssh2-streams/index.js
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/ssh2/lib/agent.js
Module not found: Error: Can't resolve 'fs' in '/Users/byra/Work/reactTest/node_modules/ssh2/lib'
@ ./node_modules/ssh2/lib/agent.js 5:9-22
@ ./node_modules/ssh2/lib/client.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/forever-agent/index.js
Module not found: Error: Can't resolve 'tls' in '/Users/byra/Work/reactTest/node_modules/forever-agent'
@ ./node_modules/forever-agent/index.js 7:10-24
@ ./node_modules/request/request.js
@ ./node_modules/request/index.js
@ ./node_modules/webhdfs/lib/webhdfs.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
ERROR in ./node_modules/tunnel-agent/index.js
Module not found: Error: Can't resolve 'tls' in '/Users/byra/Work/reactTest/node_modules/tunnel-agent'
@ ./node_modules/tunnel-agent/index.js 4:10-24
@ ./node_modules/request/lib/tunnel.js
@ ./node_modules/request/request.js
@ ./node_modules/request/index.js
@ ./node_modules/webhdfs/lib/webhdfs.js
@ ./App.jsx
@ ./main.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./main.js
webpack: Failed to compile.
나는
node: {
console: false,
fs: 'empty',
net: 'empty',
tls: 'empty'
},
아직도 문제가 동일하게 유지
target: 'node'
및
을 추가하여 webpack.config.js 파일을 변경했습니다. 이 문제를 어떻게 해결합니까? 클러스터로 ssh 할 수있는 다른 방법이 있습니까?