【问题标题】:Error while running the node js application because of typescript file由于打字稿文件,运行节点 js 应用程序时出错
【发布时间】:2020-04-05 22:22:55
【问题描述】:

这些是即将出现的错误:

D:\agent-master>npm run build

> agent@0.1.0 build D:\agent-master
> tsc

node_modules/@types/whatwg-fetch/index.d.ts(6,1): error TS2688: Cannot find type definition file for 'whatwg-streams'.
node_modules/@types/whatwg-fetch/index.d.ts(97,11): error TS2304: Cannot find name 'ReadableStream'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! agent@0.1.0 build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the agent@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\tushar.gupta\AppData\Roaming\npm-cache\_logs\2019-12-12T13_36_11_813Z-debug.log

【问题讨论】:

    标签: node.js typescript npm


    【解决方案1】:

    看起来您可能缺少包@types/node,其中包含特定于节点的所有类型,包括ReadableStream。尝试安装它,看看它是否能解决您的问题

    【讨论】:

      猜你喜欢
      • 2016-11-17
      • 1970-01-01
      • 2012-10-16
      • 1970-01-01
      • 2020-06-10
      • 1970-01-01
      • 1970-01-01
      • 2018-02-02
      • 1970-01-01
      相关资源
      最近更新 更多