TypeScript错误:TS2304:找不到名称'日期'

Ani*_*Das 7 angularjs typescript

我正在尝试创建一个javascript的日期对象来存储当前的日期和时间

let now:Date = new Date(); 
Run Code Online (Sandbox Code Playgroud)

但是下面的行在我的intellij中显示错误,如下面的错误:

TS2304:Cannot find name 'Date'.
Run Code Online (Sandbox Code Playgroud)

我猜测,因为Date是javascript对象而且在打字稿或我的项目中没有新的Date(),它失败了.

我在打字稿中写了angularjs 1.5.9,我没有任何东西与angularjs有关.

如何解决这个问题?

小智 10

步骤1.只需单击Visual Studio代码页脚中显示的版本。

步骤2.然后选择“使用工作区版本”。

你会好起来的。