You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Node.js用smb2访问Windows共享文件遇加密错误求助

Node.js 20访问Windows文件共享时smb2包出现ERR_OSSL_EVP_UNSUPPORTED错误

我需要操作另一台Windows Server文件共享中的文件,尝试通过npm install smb2来访问目录和文件,但遇到了如下错误:

node:internal/crypto/cipher:121 this[kHandle].initiv(cipher, credential, iv, authTagLength); forge.js:20:24) { library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }

我的代码如下:

const smb2Client = new smb2({
  share: "\\\\192.168.200.195\\Departments",
  domain: "CHILDER",
  username: "lukyanena.ar",
  password: "password",
});

smb2Client.readdir("/", (err, files) => {
  if (err) {
    console.error(err);
    return;
  }

  files.forEach((file) => {
    console.log(file.filename);
  });
});

当前使用Node.js 20.10.0 LTS版本,已尝试以下解决方法:

  • 检查并更新Node.js到最新LTS版本
  • 在smb2配置中指定加密方式:encryptionMethod: "aes-128-cbc"
  • 联系系统管理员,对方表示服务器无加密设置,问题在客户端

请问还有其他访问Windows文件共享的可行方法吗?


内容的提问来源于stack exchange,提问作者Artur Luckyanenko

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 03:41:01