首页 > 解决方案 > “找不到模块:错误:无法解决”错误

问题描述

我正在尝试使用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";

标签: angularssh2-sftp-client

解决方案


推荐阅读