Initializers are not allowed in ambient contexts e

2020-01-29 09:50发布

I'm trying to use the @blueprintjs/core library in my project. However, when I compile my code, I'm getting many errors like this:

node_modules/@blueprintjs/core/dist/common/classes.d.ts(4,30):
  error TS1039: Initializers are not allowed in ambient contexts.

What's going on? What am I doing wrong?

9条回答
女痞
2楼-- · 2020-01-29 10:18

This error is because of node older version of node

You can remove the node version and reinstall it by using the below comand

rm -rf node_modules //For removing
npm install //Install again(Fresh with updated one)
查看更多
Rolldiameter
3楼-- · 2020-01-29 10:22

Delete your node-modules folder and do a clean installation.

查看更多
时光不老,我们不散
4楼-- · 2020-01-29 10:25

Upgrade typescript to at least 3.1+.

查看更多
登录 后发表回答