You seem to not be depending on "@angular/core" and/or "rxjs" in Angular

Dung Do Tien Sep 02 2021 209

Hello Guys.

I have a project with Angular 7 and today I upgraded it to Angular 11 but when I try to run the project with command ng serve --o I get an error throw You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.

You seem to not be depending on '@angular/core' and/or 'rxjs' in Angular

I tried to remove node_modules and run npm install command but it does still not work for me.

Below is my Angular version:

Angular CLI: 11.2.14
Node: 14.17.5
OS: win32 x64

Angular: 11.2.14
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.14
@angular-devkit/build-angular   0.1102.14
@angular-devkit/core            11.2.14
@angular-devkit/schematics      11.2.14
@angular/cdk                    11.2.13
@angular/http                   7.2.16
@angular/material               7.3.7
@schematics/angular             11.2.14
@schematics/update              0.1102.14
rxjs                            6.6.7
typescript                      4.1.6

Anybody can tell me why? and how to fix it?

Thanks for any responses.

Have 3 answer(s) found.
  • C

    Chinh Nguyen Sep 02 2021

    I try to run the command:

    npm link

    And it solved for me.

  • M

    Mai Nguyen Nhat Dang Sep 02 2021

    Delete node_modules folder and package-lock.json file from your project directory run the below commands in the given order:

    npm install
    
    npm link
    
    ng serve --o

    Hope it solves for you.

  • N

    Nikhil Bharadwaj Sep 02 2021

    Remove node_modules folder, package-lock.json file and then run:

    npm cache clean --force
    npm cache verify
    npm i

    This solution was solved for me.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close