node.js - 由于打字稿文件,运行节点 js 应用程序时出错
问题描述
这些是即将出现的错误:
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
解决方案
看起来您可能缺少@types/node
包含所有类型的包,包括ReadableStream
特定于节点的类型。尝试安装它,看看它是否能解决您的问题
推荐阅读
- flutter - 颤振构建网络在颤振2中不起作用(缺少index.html。)
- sql - 如何有效地查询一个表以获取我需要的值,然后更改另一个表中两行的两个日期?
- python - 将每周预测 (Pandas df) 转换为每月格式
- php - 在下拉列表 PHP 中使用两个或三个 SQL 表
- python - python代码的任务调度程序(Windows)未执行,显示(0 * 1)错误
- cypress - 赛普拉斯无法点击自定义按钮
- c# - Google 日历 Api 在创建事件时返回 BadRequest,statuscode=400 错误
- outlook - 使用非 o365 配置文件(连接到自定义服务器)的 MS Teams 安排会议返回错误 FailedToGetCalendarFromOutlook
- node.js - 如何在我的后端通过 Facebook 验证社交登录?
- java - 使用管理 SDK 连接到 Firebase 实时数据库不会触发初始 onDataChange 回调