2
votes

I am using angular 7 with

"angular2-hotkeys": "^2.1.4", ..

At the running angular project, I got that error:

ERROR in node_modules/angular2-hotkeys/lib/hotkey.model.d.ts(24,9): error TS1086: An accessor cannot be declared in an ambient context.

2

2 Answers

2
votes

Finally, I got the answer, install the following package with the correct version

npm install [email protected] 

instead of install

npm install angular2-hotkeys

You should install the exact version mention in the package.json. Sometimes latest version will not be working smoothly with other packages and versions

0
votes

try doing

ng update @angular/core @angular/cli

npm install angular2-hotkeys@latest