简体   繁体   English

找不到npm模块流

[英]npm module stream not found

Since yesterday our tests don't not run anymore. 从昨天开始,我们的测试不再运行。

Error: module stream not found 错误: module stream not found

After research we found that stream is available as core node module: https://nodejs.org/api/stream.html#apicontent 经过研究,我们发现流可用作核心节点模块: https : //nodejs.org/api/stream.html#apicontent

And also available from npm: https://www.npmjs.com/package/stream 也可以从npm获得: https ://www.npmjs.com/package/stream

After npm install our package-lock.json contains of the npm package 'stream' and this is probably the problem. npm install后,我们的package-lock.json包含了npm包“ stream”,这可能是问题所在。

Is it possible to create npm packages with the name of a core module? 是否可以使用核心模块的名称创建npm软件包?

We didn't solve the failure yet, but maybe it comes from name collision of stream . 我们尚未解决失败问题,但可能是stream名称冲突引起的。

Any experience with this? 有什么经验吗?

EDIT: 编辑:

npm list shows that no npm package has stream as dependencie npm list显示没有npm软件包具有依赖关系stream

├─┬ stream@0.0.2
│ └── emitter-component@1.1.1

NPM is a package manager. NPM是程序包管理器。 Some modules names are reserved, like the fs module , but since Node API evolves and introduces new native modules every now and then, there will always be community-made modules that already exists with those names. 某些模块的名称已保留,例如fs模块 ,但是由于Node API不断发展并引入新的本机模块,因此始终会有那些名称与社区共同存在的模块。

However, according to this GitHub issue : 但是,根据此GitHub问题

built-in modules always take precedence [over npm modules] 内置模块始终优先于[npm模块]

You can try to remove the npm module, but maybe you should check your Node version. 您可以尝试删除npm模块,但也许应该检查Node版本。

By the way you don't need to add Node's core modules in your package.json file. 顺便说一下,您不需要在package.json文件中添加Node的核心模块。

removing package-lock.json and install packages via yarn solves the problem. 删除package-lock.json并通过yarn安装软件包即可解决该问题。

We still have to investigate this problem. 我们仍然必须调查这个问题。 Because our CI use npm. 因为我们的CI使用npm。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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