angular - “找不到模块:错误:无法解决”错误
问题描述
我正在尝试使用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";
解决方案
推荐阅读
- html - 无法摆脱表格之间的空间
- python - 在 Python 中创建嵌套的数据类对象
- java - Java EE REST + xml 支持:缺少 javax.xml.bind.JAXBContext
- c++ - 智能卡 API 抛出 First Chance 异常,但程序运行良好
- c# - 存储在数据库中的 ASP.NET IdentityUser 和个人资料照片
- c# - 对签名的 XML 进行故障排除
- r - 如何将 PDF 中的表格列与“texreg”对齐
- oracle-apex-5.1 - Oracle APEX - 如何根据另一个项目的值在页面加载时显示一个项目
- jdbc - 将 JDBC 和 Saxon DateTime 数据作为 ZonedDateTime 对象获取
- php - Drupal 8:尝试读取上传的文件内容