简体   繁体   English

环境枚举声明错误

[英]Ambient Enum Declaration Error

Whenever I run my Angular 4 app that calls an enum like this one... 每当我运行Angular 4应用程序时,都会调用像这样的枚举...

export declare enum RemoteStatus {
    REMOTE = "REMOTE",
    ACTIVATING = "ACTIVATING",
    ACTIVE = "ACTIVE",
    DEACTIVATING = "DEACTIVATING",
    INACTIVE = "INACTIVE",
}
export declare enum Status {
    UNKNOWN = "UNKNOWN",
    LOCKED = "LOCKED",
    UNLOCKED = "UNLOCKED",
}

It gives me an error on the ng serve console. 在ng服务控制台上给我一个错误。

ERROR in D:/Projects/nem-swiftbc-app/node_modules/nem-library/dist/src/models/account/AccountInfo.d.ts (4,14): In ambient enum declarations member initializer must be constant expression.

ERROR in D:/Projects/nem-swiftbc-app/node_modules/nem-library/dist/src/models/account/AccountInfo.d.ts (5,18): In ambient enum declarations member initializer must be constant expression.

This prevents the app from loading. 这样可以防止应用程序加载。 Any clue as to how can this be resolved? 关于如何解决的任何线索?

我设法通过更新打字稿版本来解决此问题。

npm install -g typescript@latest

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

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