Reputation: 183
I am doing drag and drop implementation and installed angular cdk for that. But on running npm start, I am landing into infinite number of errors, all related to cdk node modules only.
Below is the package.json:
{
"name": "test-proj",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/cdk": "^9.2.4",
"@angular/common": "^2.4.10",
"@angular/compiler": "^2.3.1",
"@angular/core": "^2.4.10",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",
"@angular/platform-browser": "^2.3.1",
"@angular/platform-browser-dynamic": "^2.4.10",
"@angular/router": "^3.3.1",
"core-js": "^2.4.1",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"tslib": "^2.0.0",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@angular/compiler-cli": "^2.3.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.42",
"angular-cli": "1.0.0-beta.28.3",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "^5.0.9",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "^7.0.0",
"ts-node": "1.2.1",
"tslint": "^5.20.1",
"typescript": "~2.0.3"
}
}
Errors are as follows:
> `ERROR in ~/node_modules/@angular/cdk/coercion/array.d.ts (10,60): '='
> expected.
>
> ERROR in ~j/node_modules/@angular/cdk/coercion/array.d.ts (10,75): '{'
> or ';' expected.
>
> ERROR in ~/node_modules/@angular/cdk/coercion/array.d.ts (10,40): A
> parameter initializer is only allowed in a function or constructor
> implementation.
>
> ERROR in ~/node_modules/@angular/cdk/coercion/array.d.ts (10,51):
> Cannot find name 'readonly'.
>
> ERROR in ~/node_modules/@angular/cdk/coercion/array.d.ts (10,66):
> Cannot find name 'readonly'.
>
> ERROR in ~/node_modules/@angular/cdk/coercion/array.d.ts (10,75):
> Cannot find name 'T'.
>
> ERROR in ~/node_modules/@angular/cdk/coercion/element.d.ts (13,56):
> Type 'ElementRef' is not generic.
>
> ERROR in ~/node_modules/@angular/cdk/bidi/dir-document-token.d.ts
> (8,10): Module '"~/node_modules/@angular/core/index"' has no exported
> member 'InjectionToken'.
>
> ERROR in ~/node_modules/@angular/cdk/bidi/dir.d.ts (26,9): An accessor
> cannot be declared in an ambient context.
>
> ERROR in ~/node_modules/@angular/cdk/bidi/dir.d.ts (27,9): An accessor
> cannot be declared in an ambient context.
>
> ERROR in ~/node_modules/@angular/cdk/bidi/dir.d.ts (29,9): An accessor
> cannot be declared in an ambient context.
>
> ERROR in ~/node_modules/@angular/cdk/collections/selection-model.d.ts
> (24,9): An accessor cannot be declared in an ambient context.
>
> ERROR in
> ~/node_modules/@angular/cdk/platform/features/passive-listeners.d.ts
> (19,66): Cannot find name 'AddEventListenerOptions'.
>
> ERROR in
> ~/node_modules/@angular/cdk/platform/features/passive-listeners.d.ts
> (19,92): Cannot find name 'AddEventListenerOptions'.
>
> ERROR in ~/node_modules/@angular/cdk/scrolling/scrollable.d.ts
> (13,17): ']' expected.
...... and many more like these.. .......`
The errors are seemingly syntactical, so i assume there is some version incompatibility between cdk and other angular packages may be core/common etc., I tried with that as well.
Also I tried with installing material, but same result.
Edit: My versions being used currently are:
angular-cli: 1.0.0-beta.28.3
node: 12.18.0
os: win32 x64
@angular/cdk: 9.2.4
@angular/common: 2.4.10
@angular/compiler: 2.4.10
@angular/core: 2.4.10
@angular/forms: 2.4.10
@angular/http: 2.4.10
@angular/platform-browser: 2.4.10
@angular/platform-browser-dynamic: 2.4.10
@angular/router: 3.4.10
@angular/compiler-cli: 2.4.10
Upvotes: 0
Views: 1482
Reputation: 9377
@angular/[email protected]
won't work with @angular/[email protected]
. You need @[email protected]
so it can work fine.
Upvotes: 1