In your package.json
file add this to dependencies
"hammerjs": "^2.0.8",
Or if you want an alternative automatic way just you can type npm i hammerjs --save
(or npm i [email protected] --save
if you want, since 2.0.8
is the latest version nowdays) in your root project folder and test then, if the problem still occurring try to delete the node_modules
folder and reinstall it in the root project folder also by running npm install
which will check the dependencies
(where hammerjs
resides), devDependencies
..., in package.json
file and install them.
Also in your polyfills.ts
(recommended to have a one if you have not)
import 'hammerjs/hammer';
Thus, it would be found while your angular app is executed since polyfills.ts
itself is called by import (in a normal case, else you can check it) in main.ts
which is the angular apps' entry point.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…