简体   繁体   English

将 Angular 2 升级到 Angular 4 失败

[英]Upgrade Angular 2 to angular 4 failed

I upgraded from angular 2 to angular 4 and now I'm getting an error.我从 angular 2 升级到 angular 4,现在出现错误。 I copied the text from this ie我从这个ie 复制了文本

npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save

Now I'm getting this error when I run npm start Please assist现在我在运行 npm start 时遇到这个错误请帮忙

` `

product-management@1.0.0 start C:\\Users\\dp9\\Documents\\Visual Studio 2015\\Projects\\NG\\NG UI product-management@1.0.0 启动 C:\\Users\\dp9\\Documents\\Visual Studio 2015\\Projects\\NG\\NG UI

tsc && concurrently "tsc -w" "lite-server" tsc && 同时 "tsc -w" "lite-server"

node_modules/@types/node/index.d.ts(70,5): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(70,5): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'main' must be of type 'any', but here has type 'NodeModule'.变量“main”必须是“any”类型,但这里的类型是“NodeModule”。

node_modules/@types/node/index.d.ts(81,5): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(81,5): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'parent' must be of type 'any', but here has type 'NodeModule'.变量“parent”的类型必须是“any”,但这里的类型是“NodeModule”。

node_modules/@types/node/index.d.ts(82,5): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(82,5): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'children' must be of type 'any[]', but here has type 'NodeModule[]'.变量“children”必须是“any[]”类型,但这里的类型是“NodeModule[]”。

node_modules/@types/node/index.d.ts(102,6): error TS2300: Duplicate identifier 'BufferEncoding'. node_modules/@types/node/index.d.ts(102,6): 错误 TS2300: 重复标识符“BufferEncoding”。

node_modules/@types/node/index.d.ts(263,18): error TS2300: Duplicate identifier 'EventEmitter'. node_modules/@types/node/index.d.ts(263,18): 错误 TS2300: 重复标识符“EventEmitter”。

node_modules/@types/node/index.d.ts(371,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(371,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'stdout' must be of type 'WritableStream', but here has type 'WriteStream'.变量“stdout”必须是“WritableStream”类型,但这里的类型是“WriteStream”。

node_modules/@types/node/index.d.ts(372,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(372,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'stderr' must be of type 'WritableStream', but here has type 'WriteStream'.变量“stderr”必须是“WritableStream”类型,但这里的类型是“WriteStream”。

node_modules/@types/node/index.d.ts(373,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(373,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'stdin' must be of type 'ReadableStream', but here has type 'ReadStream'.变量“stdin”必须是“ReadableStream”类型,但这里的类型是“ReadStream”。

node_modules/@types/node/index.d.ts(422,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(422,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'platform' must be of type 'string', but here has type 'Platform'.变量 'platform' 必须是 'string' 类型,但这里的类型是 'Platform'。

node_modules/@types/node/index.d.ts(580,26): error TS2300: Duplicate identifier 'Buffer'. node_modules/@types/node/index.d.ts(580,26): 错误 TS2300: 重复标识符“缓冲区”。

node_modules/@types/node/index.d.ts(580,50): error TS2300: Duplicate identifier 'SlowBuffer'. node_modules/@types/node/index.d.ts(580,50): 错误 TS2300: 重复标识符“SlowBuffer”。

node_modules/@types/node/index.d.ts(604,22): error TS2415: Class 'EventEmitter' incorrectly extends base class 'internal'. node_modules/@types/node/index.d.ts(604,22): 错误 TS2415: 类“EventEmitter”错误地扩展了基类“内部”。 Types of property 'eventNames' are incompatible.属性“eventNames”的类型不兼容。 Type '() => (string | symbol)[]' is not assignable to type '() => string[]'.类型 '() => (string | symbol)[]' 不能赋值给类型 '() => string[]'。 Type '(string | symbol)[]' is not assignable to type 'string[]'.类型 '(string | symbol)[]' 不能分配给类型 'string[]'。

node_modules/@types/node/index.d.ts(624,5): error TS2309: An export assignment cannot be used in a module with other exported elements. node_modules/@types/node/index.d.ts(624,5): 错误 TS2309: 不能在具有其他导出元素的模块中使用导出分配。

node_modules/@types/node/index.d.ts(769,18): error TS2300: Duplicate identifier 'Agent'. node_modules/@types/node/index.d.ts(769,18): 错误 TS2300: 重复标识符“代理”。

node_modules/@types/node/index.d.ts(824,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(824,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'addressType' must be of type 'string', but here has type 'number |变量 'addressType' 必须是 'string' 类型,但这里的类型是 'number | "udp4" | "udp4" | "udp6"'. “udp6”'。

node_modules/@types/node/index.d.ts(827,18): error TS2300: Duplicate identifier 'Worker'. node_modules/@types/node/index.d.ts(827,18): 错误 TS2300: 重复标识符“工人”。

node_modules/@types/node/index.d.ts(1510,17): error TS2300: Duplicate identifier 'CompleterResult'. node_modules/@types/node/index.d.ts(1510,17): 错误 TS2300: 重复标识符“CompleterResult”。

node_modules/@types/node/index.d.ts(1547,18): error TS2300: Duplicate identifier 'Script'. node_modules/@types/node/index.d.ts(1547,18): 错误 TS2300: 重复标识符“脚本”。

node_modules/@types/node/index.d.ts(2911,18): error TS2300: Duplicate identifier 'TLSSocket'. node_modules/@types/node/index.d.ts(2911,18): 错误 TS2300: 重复标识符“TLSSocket”。

node_modules/@types/node/index.d.ts(3108,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3108,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'pfx' must be of type 'any', but here has type 'string |变量 'pfx' 的类型必须是 'any',但这里的类型是 'string | Buffer[]'.缓冲[]'。

node_modules/@types/node/index.d.ts(3109,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3109,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'key' must be of type 'any', but here has type 'string |变量 'key' 的类型必须是 'any',但这里的类型是 'string | any[] |任何[] | string[] |字符串[] | Buffer'.缓冲'。

node_modules/@types/node/index.d.ts(3111,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3111,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'cert' must be of type 'any', but here has type 'string |变量 'cert' 的类型必须是 'any',但这里的类型是 'string | string[] |字符串[] | Buffer |缓冲区 | Buffer[]'.缓冲[]'。

node_modules/@types/node/index.d.ts(3112,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3112,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'ca' must be of type 'any', but here has type 'string |变量 'ca' 的类型必须是 'any',但这里的类型是 'string | string[] |字符串[] | Buffer |缓冲区 | Buffer[]'.缓冲[]'。

node_modules/@types/node/index.d.ts(3113,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3113,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'crl' must be of type 'any', but here has type 'string |变量 'crl' 的类型必须是 'any',但这里的类型是 'string | string[]'.细绳[]'。

node_modules/@types/node/index.d.ts(3115,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3115,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'honorCipherOrder' must be of type 'any', but here has type 'boolean'.变量“honorCipherOrder”必须是“any”类型,但这里的类型是“boolean”。

node_modules/@types/node/index.d.ts(3118,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3118,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'NPNProtocols' must be of type 'any', but here has type 'string[] |变量 'NPNProtocols' 的类型必须是 'any',但这里的类型是 'string[] | Buffer'.缓冲'。

node_modules/@types/node/index.d.ts(3135,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3135,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'key' must be of type 'string |变量 'key' 的类型必须是 'string | Buffer', but here has type 'string | Buffer',但这里有类型 'string | string[] |字符串[] | Buffer |缓冲区 | Buffer[]'.缓冲[]'。

node_modules/@types/node/index.d.ts(3137,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3137,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'cert' must be of type 'string |变量 'cert' 的类型必须是 'string | Buffer', but here has type 'string | Buffer',但这里有类型 'string | string[] |字符串[] | Buffer |缓冲区 | Buffer[]'.缓冲[]'。

node_modules/@types/node/index.d.ts(3138,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3138,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'ca' must be of type '(string | Buffer)[]', but here has type 'string |变量 'ca' 的类型必须是 '(string | Buffer)[]',但这里的类型是 'string | Buffer |缓冲区 | (string | Buffer)[]'. (字符串 | 缓冲区)[]'。

node_modules/@types/node/index.d.ts(3377,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3377,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'padding' must be of type 'any', but here has type 'number'.变量 'padding' 必须是 'any' 类型,但这里的类型是 'number'。

node_modules/@types/node/index.d.ts(3382,9): error TS2403: Subsequent variable declarations must have the same type. node_modules/@types/node/index.d.ts(3382,9): 错误 TS2403: 后续变量声明必须具有相同的类型。 Variable 'padding' must be of type 'any', but here has type 'number'.变量 'padding' 必须是 'any' 类型,但这里的类型是 'number'。

node_modules/@types/node/index.d.ts(3429,22): error TS2420: Class 'Readable' incorrectly implements interface 'ReadableStream'. node_modules/@types/node/index.d.ts(3429,22):错误 TS2420:“Readable”类错误地实现了“ReadableStream”接口。 Types of property 'pause' are incompatible.属性“暂停”的类型不兼容。 Type '() => Readable' is not assignable to type '{ (): ReadableStream;类型 '() => Readable' 不可分配给类型 '{(): ReadableStream; (): ReadableStream; ():可读流; }'. }'。 Type 'Readable' is not assignable to type 'ReadableStream'. “Readable”类型不可分配给“ReadableStream”类型。 Types of property 'eventNames' are incompatible.属性“eventNames”的类型不兼容。 Type '() => (string | symbol)[]' is not assignable to type '() => string[]'.类型 '() => (string | symbol)[]' 不能赋值给类型 '() => string[]'。 Type '(string | symbol)[]' is not assignable to type 'string[]'.类型 '(string | symbol)[]' 不能分配给类型 'string[]'。 node_modules/@types/node/index.d.ts(3512,22): error TS2420: Class 'Writable' incorrectly implements interface 'WritableStream'. node_modules/@types/node/index.d.ts(3512,22):错误 TS2420:“Writable”类错误地实现了“WritableStream”接口。 Types of property 'eventNames' are incompatible.属性“eventNames”的类型不兼容。 Type '() => (string | symbol)[]' is not assignable to type '() => string[]'.类型 '() => (string | symbol)[]' 不能赋值给类型 '() => string[]'。 Type '(string | symbol)[]' is not assignable to type 'string[]'.类型 '(string | symbol)[]' 不能分配给类型 'string[]'。 node_modules/@types/node/index.d.ts(3622,5): error TS2309: An export assignment cannot be used in a module with other exported elements. node_modules/@types/node/index.d.ts(3622,5): 错误 TS2309: 不能在具有其他导出元素的模块中使用导出分配。

node_modules/@types/node/index.d.ts(3705,5): error TS2300: Duplicate identifier 'export='. node_modules/@types/node/index.d.ts(3705,5): 错误 TS2300: 重复标识符 'export='。

node_modules/@types/node/index.d.ts(3727,18): error TS2300: Duplicate identifier 'Domain'. node_modules/@types/node/index.d.ts(3727,18): 错误 TS2300: 重复标识符“域”。

node_modules/@types/node/index.d.ts(3727,18): error TS2420: Class 'Domain' incorrectly implements interface 'NodeJS.Domain'. node_modules/@types/node/index.d.ts(3727,18): 错误 TS2420: 类 'Domain' 错误地实现了接口 'NodeJS.Domain'。

Types of property 'eventNames' are incompatible.属性“eventNames”的类型不兼容。 Type '() => (string | symbol)[]' is not assignable to type '() => string[]'.类型 '() => (string | symbol)[]' 不能赋值给类型 '() => string[]'。 Type '(string | symbol)[]' is not assignable to type 'string[]'.类型 '(string | symbol)[]' 不能分配给类型 'string[]'。

node_modules/@types/node/index.d.ts(4019,5): error TS2300: Duplicate identifier 'export='. node_modules/@types/node/index.d.ts(4019,5): 错误 TS2300: 重复标识符 'export='。

typings/globals/node/index.d.ts(78,6): error TS2300: Duplicate identifier 'BufferEncoding'.打字/全局/节点/index.d.ts(78,6): 错误 TS2300: 重复标识符 'BufferEncoding'。

typings/globals/node/index.d.ts(234,18): error TS2300: Duplicate identifier 'EventEmitter'. Typings/globals/node/index.d.ts(234,18): 错误 TS2300: 重复标识符“EventEmitter”。

typings/globals/node/index.d.ts(516,9): error TS2502: 'BuffType' is referenced directly or indirectly in its own type annotation. Typings/globals/node/index.d.ts(516,9): 错误 TS2502: 'BuffType' 在它自己的类型注释中被直接或间接引用。

typings/globals/node/index.d.ts(517,9): error TS2502: 'SlowBuffType' is referenced directly or indirectly in its own type annotation. Typings/globals/node/index.d.ts(517,9): 错误 TS2502: 'SlowBuffType' 在它自己的类型注释中被直接或间接引用。

typings/globals/node/index.d.ts(518,26): error TS2300: Duplicate identifier 'Buffer'.打字/全局/节点/index.d.ts(518,26):错误TS2300:重复标识符“缓冲区”。

typings/globals/node/index.d.ts(518,50): error TS2300: Duplicate identifier 'SlowBuffer'. Typings/globals/node/index.d.ts(518,50): 错误 TS2300: 重复标识符“SlowBuffer”。

typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'. Typings/globals/node/index.d.ts(580,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'EventEmitter' 和 'Server'。

Named property 'addListener' of types 'EventEmitter' and 'Server' are not identical. 'EventEmitter' 和 'Server' 类型的命名属性 'addListener' 不相同。

typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'. Typings/globals/node/index.d.ts(580,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'EventEmitter' 和 'Server'。

Named property 'emit' of types 'EventEmitter' and 'Server' are not identical. 'EventEmitter' 和 'Server' 类型的命名属性 'emit' 不相同。

typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'. Typings/globals/node/index.d.ts(580,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'EventEmitter' 和 'Server'。

Named property 'on' of types 'EventEmitter' and 'Server' are not identical. 'EventEmitter' 和 'Server' 类型的命名属性 'on' 不相同。

typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'. Typings/globals/node/index.d.ts(580,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'EventEmitter' 和 'Server'。

Named property 'once' of types 'EventEmitter' and 'Server' are not identical. 'EventEmitter' 和 'Server' 类型的命名属性 'once' 不相同。

typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'. Typings/globals/node/index.d.ts(580,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'EventEmitter' 和 'Server'。

Named property 'prependListener' of types 'EventEmitter' and 'Server' are not identical. 'EventEmitter' 和 'Server' 类型的命名属性 'prependListener' 不相同。

typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'. Typings/globals/node/index.d.ts(580,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'EventEmitter' 和 'Server'。

Named property 'prependOnceListener' of types 'EventEmitter' and 'Server' are not identical. 'EventEmitter' 和 'Server' 类型的命名属性 'prependOnceListener' 不相同。

typings/globals/node/index.d.ts(580,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Server'. Typings/globals/node/index.d.ts(580,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'EventEmitter' 和 'Server'。

Named property 'removeListener' of types 'EventEmitter' and 'Server' are not identical. 'EventEmitter' 和 'Server' 类型的命名属性 'removeListener' 不相同。

typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(591,22): 错误 TS2320: 接口 'ServerResponse' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'addListener' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“addListener”不相同。

typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(591,22): 错误 TS2320: 接口 'ServerResponse' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'emit' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“emit”不相同。

typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(591,22): 错误 TS2320: 接口 'ServerResponse' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'on' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“on”不相同。

typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(591,22): 错误 TS2320: 接口 'ServerResponse' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'once' of types 'EventEmitter' and 'Writable' are not identical. 'EventEmitter' 和 'Writable' 类型的命名属性 'once' 不相同。

typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(591,22): 错误 TS2320: 接口 'ServerResponse' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'prependListener' of types 'EventEmitter' and 'Writable' are not identical. 'EventEmitter' 和 'Writable' 类型的命名属性 'prependListener' 不相同。

typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(591,22): 错误 TS2320: 接口 'ServerResponse' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'prependOnceListener' of types 'EventEmitter' and 'Writable' are not identical. 'EventEmitter' 和 'Writable' 类型的命名属性 'prependOnceListener' 不相同。

typings/globals/node/index.d.ts(591,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(591,22): 错误 TS2320: 接口 'ServerResponse' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'removeListener' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“removeListener”不相同。

typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(621,22): 错误 TS2320: 接口 'ClientRequest' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'addListener' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“addListener”不相同。

typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(621,22): 错误 TS2320: 接口 'ClientRequest' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'emit' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“emit”不相同。

typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(621,22): 错误 TS2320: 接口 'ClientRequest' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'on' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“on”不相同。

typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(621,22): 错误 TS2320: 接口 'ClientRequest' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'once' of types 'EventEmitter' and 'Writable' are not identical. 'EventEmitter' 和 'Writable' 类型的命名属性 'once' 不相同。

typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(621,22): 错误 TS2320: 接口 'ClientRequest' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'prependListener' of types 'EventEmitter' and 'Writable' are not identical. 'EventEmitter' 和 'Writable' 类型的命名属性 'prependListener' 不相同。

typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(621,22): 错误 TS2320: 接口 'ClientRequest' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'prependOnceListener' of types 'EventEmitter' and 'Writable' are not identical. 'EventEmitter' 和 'Writable' 类型的命名属性 'prependOnceListener' 不相同。

typings/globals/node/index.d.ts(621,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'EventEmitter' and 'Writable'. Typings/globals/node/index.d.ts(621,22): 错误 TS2320: 接口 'ClientRequest' 不能同时扩展类型 'EventEmitter' 和 'Writable'。

Named property 'removeListener' of types 'EventEmitter' and 'Writable' are not identical. “EventEmitter”和“Writable”类型的命名属性“removeListener”不相同。

typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'. Typings/globals/node/index.d.ts(647,22): 错误 TS2320: 接口 'IncomingMessage' 不能同时扩展类型 'EventEmitter' 和 'Readable'。

Named property 'addListener' of types 'EventEmitter' and 'Readable' are not identical. 'EventEmitter' 和 'Readable' 类型的命名属性 'addListener' 不相同。

typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'. Typings/globals/node/index.d.ts(647,22): 错误 TS2320: 接口 'IncomingMessage' 不能同时扩展类型 'EventEmitter' 和 'Readable'。

Named property 'emit' of types 'EventEmitter' and 'Readable' are not identical. 'EventEmitter' 和 'Readable' 类型的命名属性 'emit' 不相同。

typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'. Typings/globals/node/index.d.ts(647,22): 错误 TS2320: 接口 'IncomingMessage' 不能同时扩展类型 'EventEmitter' 和 'Readable'。

Named property 'on' of types 'EventEmitter' and 'Readable' are not identical. 'EventEmitter' 和 'Readable' 类型的命名属性 'on' 不相同。

typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'. Typings/globals/node/index.d.ts(647,22): 错误 TS2320: 接口 'IncomingMessage' 不能同时扩展类型 'EventEmitter' 和 'Readable'。

Named property 'once' of types 'EventEmitter' and 'Readable' are not identical. 'EventEmitter' 和 'Readable' 类型的命名属性 'once' 不相同。

typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'. Typings/globals/node/index.d.ts(647,22): 错误 TS2320: 接口 'IncomingMessage' 不能同时扩展类型 'EventEmitter' 和 'Readable'。

Named property 'prependListener' of types 'EventEmitter' and 'Readable' are not identical. 'EventEmitter' 和 'Readable' 类型的命名属性 'prependListener' 不相同。

typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'. Typings/globals/node/index.d.ts(647,22): 错误 TS2320: 接口 'IncomingMessage' 不能同时扩展类型 'EventEmitter' 和 'Readable'。

Named property 'prependOnceListener' of types 'EventEmitter' and 'Readable' are not identical. 'EventEmitter' 和 'Readable' 类型的命名属性 'prependOnceListener' 不相同。

typings/globals/node/index.d.ts(647,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'EventEmitter' and 'Readable'. Typings/globals/node/index.d.ts(647,22): 错误 TS2320: 接口 'IncomingMessage' 不能同时扩展类型 'EventEmitter' 和 'Readable'。

Named property 'removeListener' of types 'EventEmitter' and 'Readable' are not identical. “EventEmitter”和“Readable”类型的命名属性“removeListener”不相同。

typings/globals/node/index.d.ts(698,18): error TS2300: Duplicate identifier 'Agent'. Typings/globals/node/index.d.ts(698,18): 错误 TS2300: 重复标识符“代理”。

typings/globals/node/index.d.ts(743,18): error TS2300: Duplicate identifier 'Worker'. Typings/globals/node/index.d.ts(743,18): 错误 TS2300: 重复标识符“工人”。

typings/globals/node/index.d.ts(1004,22): error TS2300: Duplicate identifier 'CompleterResult'.打字/全局/节点/index.d.ts(1004,22): 错误 TS2300: 重复标识符“CompleterResult”。

typings/globals/node/index.d.ts(1044,18): error TS2300: Duplicate identifier 'Script'. Typings/globals/node/index.d.ts(1044,18): 错误 TS2300: 重复标识符“脚本”。

typings/globals/node/index.d.ts(1323,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Socket' and 'EventEmitter'. Typings/globals/node/index.d.ts(1323,22): 错误 TS2320: 接口 'Server' 不能同时扩展类型 'Socket' 和 'EventEmitter'。

Named property 'removeListener' of types 'Socket' and 'EventEmitter' are not identical. 'Socket' 和 'EventEmitter' 类型的命名属性 'removeListener' 不相同。

typings/globals/node/index.d.ts(1886,18): error TS2300: Duplicate identifier 'TLSSocket'. Typings/globals/node/index.d.ts(1886,18): 错误 TS2300: 重复标识符“TLSSocket”。

typings/globals/node/index.d.ts(2188,18): error TS2420: Class 'Readable' incorrectly implements interface 'ReadableStream'. Typings/globals/node/index.d.ts(2188,18):错误 TS2420:“Readable”类错误地实现了“ReadableStream”接口。

Types of property 'pause' are incompatible.属性“暂停”的类型不兼容。 Type '() => Readable' is not assignable to type '{ (): ReadableStream;类型 '() => Readable' 不可分配给类型 '{(): ReadableStream; (): ReadableStream; ():可读流; }'. }'。 Type 'Readable' is not assignable to type 'ReadableStream'. “Readable”类型不可分配给“ReadableStream”类型。 Property 'isPaused' is missing in type 'Readable'. “可读”类型中缺少“isPaused”属性。 typings/globals/node/index.d.ts(2211,18): error TS2420: Class 'Writable' incorrectly implements interface 'WritableStream'. Typings/globals/node/index.d.ts(2211,18):错误 TS2420:“Writable”类错误地实现了“WritableStream”接口。

Types of property 'eventNames' are incompatible.属性“eventNames”的类型不兼容。 Type '() => (string | symbol)[]' is not assignable to type '() => string[]'.类型 '() => (string | symbol)[]' 不能赋值给类型 '() => string[]'。 Type '(string | symbol)[]' is not assignable to type 'string[]'.类型 '(string | symbol)[]' 不能分配给类型 'string[]'。 Type 'string |输入'字符串| symbol' is not assignable to type 'string'.符号'不可分配给类型'字符串'。 Type 'symbol' is not assignable to type 'string'. “符号”类型不能分配给“字符串”类型。 typings/globals/node/index.d.ts(2229,18): error TS2420: Class 'Duplex' incorrectly implements interface 'ReadWriteStream'. Typings/globals/node/index.d.ts(2229,18):错误 TS2420:“Duplex”类错误地实现了“ReadWriteStream”接口。

Types of property 'pause' are incompatible.属性“暂停”的类型不兼容。 Type '() => Duplex' is not assignable to type '{ (): ReadWriteStream;类型 '() => Duplex' 不能分配给类型 '{(): ReadWriteStream; (): ReadWriteStream; (): 读写流; }'. }'。 Type 'Duplex' is not assignable to type 'ReadWriteStream'. “Duplex”类型不能分配给“ReadWriteStream”类型。 Property 'isPaused' is missing in type 'Duplex'. “双工”类型中缺少“isPaused”属性。 typings/globals/node/index.d.ts(2250,18): error TS2420: Class 'Transform' incorrectly implements interface 'ReadWriteStream'. Typings/globals/node/index.d.ts(2250,18): 错误 TS2420: Class 'Transform' 错误地实现了接口 'ReadWriteStream'。

Types of property 'pause' are incompatible.属性“暂停”的类型不兼容。 Type '() => Transform' is not assignable to type '{ (): ReadWriteStream;类型 '() => Transform' 不可分配给类型 '{(): ReadWriteStream; (): ReadWriteStream; (): 读写流; }'. }'。 Type 'Transform' is not assignable to type 'ReadWriteStream'.类型“Transform”不可分配给类型“ReadWriteStream”。 Property 'isPaused' is missing in type 'Transform'. “转换”类型中缺少属性“isPaused”。 typings/globals/node/index.d.ts(2343,5): error TS2300: Duplicate identifier 'export='.打字/全局/节点/index.d.ts(2343,5):错误TS2300:重复标识符'export='。

typings/globals/node/index.d.ts(2365,18): error TS2300: Duplicate identifier 'Domain'. Typings/globals/node/index.d.ts(2365,18): 错误 TS2300: 重复标识符“域”。

typings/globals/node/index.d.ts(2365,18): error TS2420: Class 'Domain' incorrectly implements interface 'NodeJS.Domain'. Typings/globals/node/index.d.ts(2365,18): 错误 TS2420: Class 'Domain' 错误地实现了接口 'NodeJS.Domain'。

Types of property 'eventNames' are incompatible.属性“eventNames”的类型不兼容。 Type '() => (string | symbol)[]' is not assignable to type '() => string[]'.类型 '() => (string | symbol)[]' 不能赋值给类型 '() => string[]'。 Type '(string | symbol)[]' is not assignable to type 'string[]'.类型 '(string | symbol)[]' 不能分配给类型 'string[]'。 typings/globals/node/index.d.ts(2625,5): error TS2300: Duplicate identifier 'export='.打字/全局/节点/index.d.ts(2625,5):错误TS2300:重复标识符'export='。

` `

Uninstall typings.卸载打字。 Typescript types are now managed by npm under the @types namespace: Typescript 类型现在由 @types 命名空间下的 npm 管理:

npm uninstall --save typings

Also, delete the typings subdirectory.另外,删除typings 子目录。

To update from Angular 2 to Angular 4 please follow this steps:要从 Angular 2 更新到 Angular 4,请按照以下步骤操作:

1 - Ensure you don't use extends OnInit, or use extends with any lifecycle event. 1 - 确保您不使用 extends OnInit,或将 extends 与任何生命周期事件一起使用。 Instead use implements <lifecycle event> .而是使用 implements <lifecycle event>

2 - Update all of your dependencies to version 4 and the latest TypeScript using 2 - 使用更新所有依赖项到版本 4 和最新的 TypeScript

Mac/Linux Mac/Linux

npm install @angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}@4.0.0 typescript@latest --save

Windows窗户

 npm install @angular/common@next @angular/compiler@next @angular/compiler-cli@next @angular/core@next @angular/forms@next @angular/http@next @angular/platform-browser@next @angular/platform-browser-dynamic@next @angular/platform-server@next @angular/router@next @angular/animations@next --save

3 - If you use animations in your application, you should import BrowserAnimationsModule from @angular/platform-browser/animations in your App NgModule. 3 - 如果您在应用程序中使用动画,则应从应用程序 NgModule 中的 @angular/platform-b​​rowser/animations 导入 BrowserAnimationsModule。

4 - Rename your template tags to ng-template. 4 - 将您的模板标签重命名为 ng-template。

5 - If you want to validate your forms add ngNativeValidate because angular 4 added novalidate attribute to all forms 5 - 如果您想验证您的表单,请添加 ngNativeValidate 因为 angular 4 向所有表单添加了 novalidate 属性


if you still having some issues try to update nodejs and Typescript npm install -g typescript@latest如果您仍然遇到一些问题,请尝试更新nodejs和 Typescript npm install -g typescript@latest typescript install -g typescript@latest

If none of that helped please update your Angular CLI to the latest version如果这些都没有帮助,请将您的 Angular CLI 更新到最新版本

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest

and generate a new Angular 4 project using ng new newProject and move your logic and templates to the new app.并使用ng new newProject生成一个新的 Angular 4 项目,并将您的逻辑和模板移动到新应用程序中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM