环境枚举声明错误

时间:2017-08-04 04:58:48

标签: javascript angular

每当我运行我的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",
}

它在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.

这可以防止加载应用。关于如何解决这个问题的任何线索?

1 个答案:

答案 0 :(得分:0)

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

npm install -g typescript@latest
相关问题