简体   繁体   English

ENOENT 错误:找不到这样的文件或目录,打开“节点:流”

[英]ENOENT error: no such file or directory found, open 'node:stream'

I am currently trying to test a new implementation.我目前正在尝试测试一个新的实现。 One of the dependencies of the functions of my new implementation uses the Writable module from node:stream to create a writable stream.我的新实现的函数的依赖项之一使用 node:stream 中的 Writable 模块来创建可写的 stream。 My problem is when trying to run the suit of tests I get this error.我的问题是在尝试运行测试套件时出现此错误。

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)

I'm assuming there must be some error on how node is accessing the the directory library for node:stream.我假设节点如何访问节点的目录库必须有一些错误:stream。 How do I fix / change this?我该如何解决/改变这个?

I had a very similar problem with a require("constants") call in the iso-constants library when running jest tests.在运行 jest 测试时,我在iso-constants库中调用require("constants")时遇到了非常相似的问题。 In my case someone else had already sent a pull request with a workaround for the iso-contants library, so I simply added overrides to my package.json until the pull request is fixed:在我的情况下,其他人已经发送了一个带有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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM