-1

I downloaded an Angular 12 project and I am trying to run it using Angular 13 (latest version). Thus I have problems thrown when I try to run it it. Even if I tried to use npm install, some dependency issues are thrown

Errors thrown when running using ng serve:

An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
Require stack:
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
- /usr/local/lib/node_modules/@angular/cli/models/architect-command.js
- /usr/local/lib/node_modules/@angular/cli/commands/serve-impl.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/export-ref.js
- /usr/local/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/tools/index.js
- /usr/local/lib/node_modules/@angular/cli/utilities/json-schema.js
- /usr/local/lib/node_modules/@angular/cli/models/command-runner.js
- /usr/local/lib/node_modules/@angular/cli/lib/cli/index.js
- /usr/local/lib/node_modules/@angular/cli/lib/init.js
See "/private/var/folders/w0/wfq3__js19g4lbf33bpkwbrm0000gp/T/ng-hQcZ24/angular-errors.log" for further details.

I tried to use the npm install, but also some other errors where thrown:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: black-dashboard-angular@1.2.0
npm ERR! Found: rxjs@7.2.0
npm ERR! node_modules/rxjs
npm ERR!   rxjs@"7.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"^6.5.3" from @angular/core@12.1.2
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"12.1.2" from the root project
npm ERR!   peer @angular/core@"12.1.2" from @angular/animations@12.1.2
npm ERR!   node_modules/@angular/animations
npm ERR!     @angular/animations@"12.1.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/aless/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:

Any help please ?

N.F.
  • 3,844
  • 3
  • 22
  • 53
Mlle 116
  • 1,149
  • 4
  • 20
  • 53

1 Answers1

0

Try update the projects angular version from v12 to v13 by running:

npx @angular/cli@13 update @angular/core@13 @angular/cli@13

And then run npm install

Hope this works

GlenH
  • 101
  • 4
  • I tried but it returned this error too: ```Package '@angular/core' is not a dependency.``` – Mlle 116 Nov 25 '21 at 22:15
  • 1
    It's because of the missing `node_modules` folder given that running `npm install` threw up an error. – GlenH Nov 25 '21 at 22:39