ОШИБКА в node_modules/@angular/common/http/src/response.d.ts (253,21) - PullRequest
0 голосов
/ 10 декабря 2018

root @ localhost: / var / www / html / abcd-seed # ng serve Ваша глобальная версия Angular CLI (7.1.2) больше вашей локальной версии (6.2.8).Используется локальная версия Angular CLI.

To disable this warning use "ng config -g cli.warnings.versionMismatch 
false".
** Angular Live Development Server is listening on localhost:4200, 
open your browser on http://localhost:4200/ **

Date: 2018-12-10T14:35:22.329Z
Hash: 35a983178ac09d7b7950
Time: 25011ms
chunk {main} main.js, main.js.map (main) 1.89 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 673 bytes 
[initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] 
[rendered]
chunk {styles} styles.js, styles.js.map (styles) 311 kB [initial] 
[rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 329 kB [initial] 
[rendered]

ERROR in node_modules/@angular/common/http/src/response.d.ts(253,21): 
error TS1039: Initializers are not allowed in ambient contexts.
node_modules/@angular/common/http/src/response.d.ts(259,19): error 
TS1039: Initializers are not allowed in ambient contexts.
node_modules/@angular/core/src/application_init.d.ts(26,21): error 
TS1039: Initializers are not allowed in ambient contexts.
node_modules/@angular/core/src/ivy_switch.d.ts(8,54): error TS1254: A 
'const' initializer in an ambient context must be a string or numeric   
literal.
node_modules/@angular/core/src/ivy_switch.d.ts(9,35): error TS1254: A 
'const' initializer in an ambient context must be a string or numeric 
literal.
node_modules/@angular/core/src/linker/query_list.d.ts(36,22): error 
TS1039: Initializers are not allowed in ambient contexts.

ℹ 「wdm」: Failed to compile.

1 Ответ

0 голосов
/ 11 декабря 2018

Просто удалил node_modules и package-lock.json и обновил мой проект, который работает для меня.я следовал за этим https://medium.com/@jeroenouw/upgrade-to-angular-6-4520e46c682b

...