[英]typescript compile error in body-parser.d.ts: Could not find symbol 'Buffer'
I am getting the following compile errors in body-parser.d.ts when compiling my typescript file. 编译我的打字稿文件时,在body-parser.d.ts中收到以下编译错误。
error TS2095: Could not find symbol 'Buffer'. 错误TS2095:找不到符号“缓冲区”。 error TS2094: The property 'RequestHandler' does not exist on value of type 'express'.
错误TS2094:类型'express'的值上不存在属性'RequestHandler'。
And I have the following lines in my app.ts file. 我的app.ts文件中包含以下几行。
///<reference path='../Scripts/typings/node/node.d.ts'/>
///<reference path='../Scripts/typings/body-parser/body-parser.d.ts'/>
import express = require('express');
import bodyParser = require('body-parser');
import http = require('http');
import path = require('path');
Why am I getting the errors? 为什么会出现错误?
Make sure you have express.d.ts
as it is required for body-parser.d.ts
: https://github.com/borisyankov/DefinitelyTyped/blob/master/body-parser/body-parser.d.ts#L6 请确保您有
express.d.ts
,因为它需要body-parser.d.ts
: https://github.com/borisyankov/DefinitelyTyped/blob/master/body-parser/body-parser.d.ts# L6
Very unlikely to be a bug in the Definitions as DefinitelyTyped is compiled to make sure that such errors don't make it to users like yourself. 由于DefinitelyTyped会被编译以确保此类错误不会对像您这样的用户产生影响,因此不太可能是“定义”中的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.