[英]ENOENT error: no such file or directory found, open 'node:stream'
我目前正在尝试测试一个新的实现。 我的新实现的函数的依赖项之一使用 node:stream 中的 Writable 模块来创建可写的 stream。 我的问题是在尝试运行测试套件时出现此错误。
ENOENT: no such file or directory, open 'node:stream'
at Runtime.readFile (node_modules/jest-runtime/build/index.js:1987:21)
at Object.<anonymous> (node_modules/@uktvtech/common-utils/src/fileTransferProtocol/getFTPClient.ts:6:1)
我假设节点如何访问节点的目录库必须有一些错误:stream。 我该如何解决/改变这个?
在运行 jest 测试时,我在iso-constants
库中调用require("constants")
时遇到了非常相似的问题。 在我的情况下,其他人已经发送了一个带有iso-contants
库解决方法的拉取请求,所以我只是将覆盖添加到我的 package.json 直到拉取请求得到修复:
"resolutions": {
"iso-constants": "git+https://github.com/inverted-capital/iso-constants.git#patch-1"
},
"overrides": {
"iso-constants": {
".": "git+https://github.com/inverted-capital/iso-constants.git#patch-1"
}
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.