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

问题描述 投票:0回答:1

自从我更新到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
angular
1个回答
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"

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

© www.soinside.com 2019 - 2024. All rights reserved.