The specified main access point, "@angular/cdk/platform", is lacking in required dependencies

I recently updated my Angular app from version 8 to version 9. After resolving all compilation and linter errors, I encountered one specific issue that is causing me trouble:

ERROR in The target entry-point "@angular/cdk/platform" has missing dependencies:

@angular/core
@angular/common

Here are the angular packages listed in my package.json file:

        "@angular/animations": "10.0.12",
        "@angular/cdk": "10.1.3",
        "@angular/common": "10.0.12",
        "@angular/compiler": "10.0.12",
        "@angular/core": "10.0.12",
        "@angular/flex-layout": "10.0.0-beta.32",
        "@angular/forms": "10.0.12",
        "@angular/material": "10.1.3",
        "@angular/platform-browser": "10.0.12",
        "@angular/platform-browser-dynamic": "10.0.12",
        "@angular/router": "10.0.12",

I have already tried numerous solutions like removing node_modules, package-lock.json, and re-installing dependencies.

Although I suspected the error might be related to the ivy compiler, it seems to be compiling everything correctly:

> ngcc --tsconfig './src/tsconfig.app.json' && bash post-install-checks.sh

Compiling @angular/cdk/platform : fesm2015 as esm2015
(and others)

What could possibly be causing this particular error? Am I overlooking something important?

Furthermore, I have also come across additional errors during my troubleshooting process:

/myDevFolder/my-app/node_modules/@types/d3-shape/index.d.ts
Error:(2273, 19) TS2304: Cannot find name 'CanvasPathMethods'.
(myDevFolder/my-app/node_modules/protractor/built/index.d.ts
Error:(5, 10) TS2440: Import declaration conflicts with local declaration of 'PluginConfig'.
Error:(5, 24) TS2440: Import declaration conflicts with local declaration of 'ProtractorPlugin'.
...

Additional Information

Upon rerunning the migrations for ng update, a new error was identified:

❯ Undecorated classes with DI migration.
  As of Angular 9, it is no longer supported to use Angular DI on a class that does not have an Angular decorator.
  Read more about this here: https://v9.angular.io/guide/migration-undecorated-classes
Failed to read JSON file /myDevFolder/dev/node_modules/@angular/material/typings/core/index.metadata.json
    
    This migration uses the Angular compiler internally and therefore projects that no longer build successfully after the update cannot run the migration. Please ensure there are no AOT compilation errors and rerun the migration. The following project failed: src/tsconfig.app.json
    
    Error: Path "/../node_modules/@angular/material/typings/core/index.metadata.json" is invalid.
    
    Could not migrate all undecorated classes that use dependency
    injection. Some project targets could not be analyzed due to
    TypeScript program failures.

Answer №1

If you're struggling with missing material dependencies after updating to Angular 9, I stumbled upon a helpful solution here: Missing material dependencies after upgrade to Angular 9. It might just do the trick for you too. Here's a quick overview of what worked:

  • First step is to delete the node_modules folder.
  • Second, get rid of the package-lock.json file.
  • Then, run npm cache clean --force
  • After that, execute npm install --save @angular/material @angular/cdk
  • And finally, run npm install

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Striking through the value of a Material-UI TextField variant label

For my project, I attempted to implement the TextField component from Material-UI in the outlined variant. However, I encountered an issue where the label overlaps with the value. How can I resolve this issue? Check out this screenshot showing the mixed-u ...

Utilize multiple activated modules in Angular 2

Recently, I've been exploring the new features of Angular 2 final release, particularly the updated router functionality. An interesting example showcasing the router in action can be found at this link: http://plnkr.co/edit/mXSjnUtN7CM6ZqtOicE2?p=pr ...

Tsuquyomi pays no attention to any mistakes when opening

I have integrated Tsuquyomi as a Syntastic plugin for TypeScript error checking in Vim. However, I am facing an issue where only ESLint errors are displayed when I open a file, and Tsuquyomi errors are only visible when I save the file or manually run the ...

Error: The function expressJwt is not recognized as a valid middleware

As I delve into learning about middlewares, I encountered an issue when trying to import express-jwt. The syntax I used was: const expressJwt = require('express-jwt') To address the problem, I uninstalled the current version of express-jwt and i ...

Node.js v14.4.0 is not compatible with npm library

Hello there, fellow tech enthusiasts! I've encountered a peculiar issue while upgrading Node.js and npm on my Ubuntu 18.04.6 server. Following the installation guides, I initially used the commands: curl -fsSL https://deb.nodesource.com/setup_17.x | ...

Every time I attempt to run the npx command, I encounter an error that says: "Error: EPERM: operation not permitted

Struggling to install the create-guten-block package using the command npx create-guten-block my-block, but unfortunately, it's not working out for me. My current node version is 10.15.1 Npm version I'm on is 6.4.1 Encountering the error shown ...

Adding types to computed properties in Vue 3's Composition API is a seamless process

Having an issue where I am trying to add type to computed but keep encountering this error: Overload 1 of 2, '(getter: ComputedGetter<AuthFormType>, debugOptions?: DebuggerOptions | undefined): ComputedRef<AuthFormType>', gave the fol ...

Expo Snack shows the error message "package not found in registry" while trying to add an npm package

While working on my project in Expo Snack, I came across an issue with the public npm package mentioned below. The strange thing is that I can access and utilize the package locally within my app without any problems, but when I try to run it through Exp ...

The Subscription request did not trigger as expected

I encountered an issue where I needed to call two services in the OnInit step, but the second request was not being sent. As a workaround, I had to call them sequentially, which I believe is not the most efficient way to write the code. (Both services on t ...

Is the installation of a root package synonymous with the automatic installation of a scoped library?

Upon installing a root library, like npm install aws-amplify, I often find that I also need to install its sub-library, such as npm install @aws-amplify/cli. Why doesn't the initial installation of npm install aws-amplify cover all sub-libraries withi ...

What is the best method for incorporating a variable into an Ionic iframe?

Can anyone help with integrating a variable into an Ionic iframe? <ion-content> <iframe src="http://local/server_api/pr.php?p={{insert-variable-here}}" style="width: 100%; min-height: 100%; height: 100%;" frameborder= ...

When using tsdx with React, null values can prevent proper usage of hooks

Recently, I attempted to develop a React TypeScript component using tsdx for compilation and encountered a roadblock while debugging. The package appears to be successfully published and installed without any errors. However, when trying to use it, I consi ...

Passing a parameter from a redirect function to an onClick in React using TypeScript

I am facing a challenge in passing a parameter to my redirectSingleLocker function. This function is intended to take me to the detailed page of a specific locker, identified by a guid. The lockerData.map method is used to display all the JSON data in a ta ...

The inability to publish npm libraries on the repository is a common issue faced when using Npm in conjunction with Nexus Repository Manager 3

I am currently facing a challenge uploading npm libraries to a Nexus Repository Manager 3.1 that is located on a server without internet access. To work around this issue, I performed an npm install on a separate computer to obtain the necessary libraries ...

Having difficulty initializing a constant object in TypeScript

Encountering an error while attempting to compile my code using Angular 7.2.0 and TypeScript version 3.2.2: Error TS1005: ',' expected.**… The issue seems to be arising from the line where I am trying to define a const object. addAppareil( ...

angular2-highcharts series highlighting feature

I am working with an angular2-highcharts chart and I am trying to highlight specific lines of a data series when clicked. However, when using the code below, I encounter an error message that says Cannot read property 'series' of undefined. T ...

Utilize the Node Version as a primary identifier for Cache@2 Azure DevOps task configuration

After reviewing the documentation pertaining to the Cache@2 task, we established this specific key for the task: - task: Cache@2 inputs: key: 'npm | "$(Agent.OS)" | package-lock.json | package.json' # etc. Prior to that, Node was installed ...

The static side of the class `typeof _Readable` is erroneously extending the static side of the base class `typeof Readable`

I am currently developing a Discord bot using node/typescript. After running the typescript compiler on my code, I encountered this error: node_modules/@types/readable-stream/index.d.ts(13,15): error TS2417: Class static side 'typeof _Readable' ...

Error: There was a problem trying to import the `.d.ts` file

Software Stack Vue version 3.2.19 @vue/test-utils version 2.0.0-rc.15 Typescript version 4.1.6 Issue Description Encountering an error when running the command vue-cli-service test:unit --no-cache. Please refer to the TypeError screenshot (link to Con ...

The value returned by a mocked Jest function is ignored, while the implemented function is not invoked

Having an issue with mocking the getToken function within my fetchData method in handler.ts while working with ts-jest. I specifically want to mock the response from getToken to avoid making the axios request when testing the fetchData method. However, des ...