'Cannot find module '@angular/cdk/clipboard
I use angular material and after installing I got this error. my package.json. I'm using angular 8 and tried to changes to the versions of angular material.
"dependencies": {
"@angular/animations": "~8.2.9",
"@angular/cdk": "^8.2.3",
"@angular/common": "~8.2.9",
"@angular/compiler": "~8.2.9",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.9",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "~8.2.9",
"@angular/platform-browser-dynamic": "~8.2.9",
"@angular/router": "~8.2.9",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.9",
"@angular/cli": "~8.3.9",
"@angular/compiler-cli": "~8.2.9",
"@angular/language-service": "~8.2.9",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
}
Solution 1:[1]
try using installing this
npm install --save @angular/material @angular/cdk
Solution 2:[2]
Try using ng add @angular/material to install Angular Material to your project. This will automatically install the CDK and other dependencies of Angular Material.
Documentation Reference Link Click Here
Solution 3:[3]
I generated it again using angular cli which prevented all these errors.
Solution 4:[4]
npm install --save @angular/material @angular/cdk
will resolve this issue
Solution 5:[5]
It looks like the clipboard is supported from Angular9.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vaibhav Mahajan |
| Solution 2 | SaiSurya |
| Solution 3 | Mahmoud Nafea |
| Solution 4 | Seena Viovin |
| Solution 5 | Ever |
