Upon discovering a broken Jenkins build of our Angular app, the error message below was encountered:
ERROR in node_modules/angular2-hotkeys/lib/hotkeys.service.d.ts:9:16 - error TS2304: Cannot find name 'MousetrapInstance'.
9 mousetrap: MousetrapInstance;
~~~~~~~~~~~~~~~~~
The issue stems from a breaking change in @types/mousetrap
, transitioning from:
export const mousetrap: MousetrapInstance;
to:
export const mousetrap: Mousetrap.MousetrapInstance;
Within the angular2-hotkeys package.json
, dependencies are specified as follows:
"dependencies": {
"mousetrap": "^1.6.0",
"@types/mousetrap": "^1.6.0"
},
What is the recommended NPM approach to circumvent this versioning issue?