我正在尝试使用ssh2-sftp-client
包 5.3.1 版本,Angular 9.0.4
但遇到了很多错误,例如;
ERROR in ./node_modules/ssh2-sftp-client/lib/http-agents.js
Module not found: Error: Can't resolve 'https' in 'C:\workspace\myProject\node_modules\ssh2-sftp-client\lib'
和
ERROR in ./node_modules/ssh2-sftp-client/lib/agent.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\myProject\node_modules\ssh2-sftp-client\lib'
我这样做npm i ssh2-sftp-client
并像这样导入到课堂上;
import SFTPClient from "ssh2-sftp-client";