0
votes

I am writing an ionic Angular app, and recently cloned the repo to another machine.

Next I did an npm install then an ionic serve which results in the following error:

$ ionic serve ng.cmd run app:serve --host=localhost --port=8100
[ng] An unhandled exception occurred: Package "@angular-devkit/build-angular" has no builders defined.
[ng] See "C:\Users\wadef\AppData\Local\Temp\ng-NUA28c\angular-errors.log" for further details.

The error log has the following:

[error] Error: Package "@angular-devkit/build-angular" has no builders defined.
at WorkspaceNodeModulesArchitectHost.resolveBuilder (C:\code\powercut\node_modules@angular-devkit\architect\node\node-modules-architect-host.js:46:19)
at RunCommand.runSingleTarget (C:\code\powercut\node_modules@angular\cli\models\architect-command.js:175:55)
at async RunCommand.runArchitectTarget (C:\code\powercut\node_modules@angular\cli\models\architect-command.js:217:24)

I've tried:

  • deleting package-lock.json and doing a fresh npm install
  • specifically reinstalling @angular-devkit/build-angular
  • searching for the error message, but I cannot find a single reference to it
1
probably your angular.json is not correctly configuredPoul Kruijt
Do you have the Ionic CLI installed globally on the machine you're using?R. Richards
@R.Richards yes, along with the Angular CLIwlf

1 Answers

0
votes

I ended up creating a new blank ionic project so I could compare angular.json as prompted by Poul's comment. I got a bunch of different errors which lead me to do the following:

<added NODE_PATH environment variable>
npm install -g npm
npm cache verify
<delete package-lock.json>
npm install

The error no longer occurs.