Angular 9在Build上出错:找不到WriteStream & ReadStream这个名字。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Angular 9在Build上出错:找不到WriteStream & ReadStream这个名字。相关的知识,希望对你有一定的参考价值。

自从我更新到Angular 9后,我无法构建我的应用程序。ng serve 工作完美。这似乎是一个错误的typecript,但我不明白它。

你能帮助我吗?

错误的构建 。

ERROR in node_modules/@types/node/globals.d.ts:838:17 - error TS2304: Cannot find name 'WriteStream'.
838         stdout: WriteStream;
                    ~~~~~~~~~~~
node_modules/@types/node/globals.d.ts:842:17 - error TS2304: Cannot find name 'WriteStream'.
842         stderr: WriteStream;
                    ~~~~~~~~~~~
node_modules/@types/node/globals.d.ts:843:16 - error TS2304: Cannot find name 'ReadStream'.
843         stdin: ReadStream;
                   ~~~~~~~~~~

我的Angular配置 。

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.1.1
Node: 12.16.2
OS: linux x64

Angular: 9.1.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.1
@angular-devkit/build-angular     0.901.1
@angular-devkit/build-optimizer   0.901.1
@angular-devkit/build-webpack     0.901.1
@angular-devkit/core              9.1.1
@angular-devkit/schematics        9.1.1
@angular/cli                      9.1.1
@ngtools/webpack                  9.1.1
@schematics/angular               9.1.1
@schematics/update                0.901.1
rxjs                              6.5.5
typescript                        3.8.3
webpack                           4.42.0
答案

我阅读了我最近的提交,我看到了一些非常有趣的东西!

我用Sentry设置了发布跟踪 (https:/docs.sentry.ioworkflowreleases?platform=javascript。)与npm版本的自动获取。

发布 : process.env.npm_package_version

而我的IDE(Webstorm)会自动在我的tsconfig.app.json中添加一行。

  "files": [
    ...,
    "../node_modules/@types/node/globals.d.ts"

如果没有这行,它工作得很好,但我必须手动写版本!

以上是关于Angular 9在Build上出错:找不到WriteStream & ReadStream这个名字。的主要内容,如果未能解决你的问题,请参考以下文章

找不到模块“@angular-devkit/build-angular”

错误:找不到模块'@ckeditor/ckeditor5-build-classic'角度9的声明文件

错误:找不到模块'@angular-devkit/build-angular/package.json'

发生未处理的异常:找不到模块'@angular-devkit/build-angular/package.json'

Angular Production Build 找不到插件“proposal-numeric-separator”

离子应用程序:发生未处理的异常:找不到模块“@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/uti