1

I´m trying to run an Angular project through ng serve, but desafortunately doesn´t run. The next message show in the console:

An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
Require stack:
- C:\Project\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
- C:\Project\node_modules\@angular-devkit\architect\node\index.js
- C:\Project\node_modules\@angular\cli\models\architect-command.js
- C:\Project\node_modules\@angular\cli\commands\serve-impl.js
- C:\Project\node_modules\@angular-devkit\schematics\tools\export-ref.js
- C:\Project\node_modules\@angular-devkit\schematics\tools\index.js
- C:\Project\node_modules\@angular\cli\utilities\json-schema.js
- C:\Project\node_modules\@angular\cli\models\command-runner.js
- C:\Project\node_modules\@angular\cli\lib\cli\index.js
- C:\Users\Test\AppData\Roaming\npm\node_modules\@angular\cli\lib\init.js
- C:\Users\Test\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng
See "C:\Users\Test\AppData\npm\ng-Tomy1t\angular-errors.log" for further details.

How Can I fix this issue?

1
  • What does your package.json look like? (And what does the ng version output look like?) Commented Dec 13, 2020 at 3:54

1 Answer 1

1

This package was newly introduce from angular 6.0 onwards, You need to Install @angular-devkit/build-angular as dev dependency.

Try adding the devkit using this command:

If you are using NPM Package manager:

npm install --save-dev @angular-devkit/build-angular

If you are using yarn package manager:

yarn add @angular-devkit/build-angular --dev
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.