angular-cli: Could not find the implementation for builder @angular-devkit/build-angular:browser

🐞 Bug report

- [ ] new
- [ x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

I tried to build the project using ng build --prod I got this error.

πŸ”₯ Exception or Error



Could not find the implementation for builder @angular-devkit/build-angular:browser
Error: Could not find the implementation for builder @angular-devkit/build-angular:browser
    at WorkspaceNodeModulesArchitectHost.resolveBuilder (/Volumes/Data/Angular/htdocs/thecampus-angular/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:49:19)
    at BuildCommand.initialize (/Volumes/Data/Angular/htdocs/thecampus-angular/node_modules/@angular/cli/models/architect-command.js:135:55)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:757:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

🌍 Your Environment



Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        8.0.0
@angular/cli                      8.0.0
@angular/compiler-cli             8.0.0
@ngtools/webpack                  6.0.8
@schematics/angular               8.0.0
@schematics/update                0.800.0
rxjs                              5.5.12
typescript                        2.5.3
webpack                           4.8.3
    


About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 34

Most upvoted comments

What have worked for me was:

1.) Make sure your angular version starts with 7.2.15 (if not, you should install this version first) 2.) Be sure your Node version is 12.x.x 3.) Typescript version 3.4.5 3.) ng update @angular/cli @angular/core (for @angular/cli, be sure to install it both local & global) 4.) npm uninstall @angular-devkit/build-angular 5.) npm install @angular-devkit/build-angular 6.) ng update --all 7.) If you have ViewChild on your application, be sure to edit them with: Source

@ViewChild(<name>, {static: true}) <name>; // Adding static: true on the 2nd param

I got this error when I to upgrade from angular 7 to 8

Could not find the implementation for builder @angular-builders/dev-server:generic
Error: Could not find the implementation for builder @angular-builders/dev-server:generic

I got this error when I to upgrade from angular 7 to 8

Could not find the implementation for builder @angular-builders/dev-server:generic
Error: Could not find the implementation for builder @angular-builders/dev-server:generic

For my case, I found the reason from here https://github.com/meltedspark/angular-builders/blob/master/MIGRATION.MD

npm audit fix worked for me

Hi, @angular/cli version 8 will only work with Angular version 8.

Unfortunately Angular version 5 and CLI version 1, are not longer supported https://angular.io/guide/releases#support-policy-and-schedule

I suggest you update to version 8 by running the update command via ng update @angular/cli @angular/core, This is suggested because when running the update command several migrations will be executed to make your project compatible with the new version which otherwise you’d need to do manually.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

I faced this issue after updating the typescript to latest version but it was resolved by ng update @angular/core in project

worked for me

What have worked for me was:

1.) Make sure your angular version starts with 7.2.15 (if not, you should install this version first) 2.) Be sure your Node version is 12.x.x 3.) Typescript version 3.4.5 3.) ng update @angular/cli @angular/core (for @angular/cli, be sure to install it both local & global) 4.) npm uninstall @angular-devkit/build-angular 5.) npm install @angular-devkit/build-angular 6.) ng update --all 7.) If you have ViewChild on your application, be sure to edit them with: Source

@ViewChild(<name>, {static: true}) <name>; // Adding static: true on the 2nd param

One important thing…be VERY CAREFUL with running the command of β€œng update --all” At this point in time, it upgraded my karma/jasmine to an unstable version and caused me so much pain to figure out the root cause (tests would randomly fail).

What have worked for me was:

1.) Make sure your angular version starts with 7.2.15 (if not, you should install this version first) 2.) Be sure your Node version is 12.x.x 3.) Typescript version 3.4.5 3.) ng update @angular/cli @angular/core (for @angular/cli, be sure to install it both local & global) 4.) npm uninstall @angular-devkit/build-angular 5.) npm install @angular-devkit/build-angular 6.) ng update --all 7.) If you have ViewChild on your application, be sure to edit them with: Source

@ViewChild(<name>, {static: true}) <name>; // Adding static: true on the 2nd param

step 6 fails with:

Using package manager: 'npm'
Collecting installed dependencies...
Found 35 dependencies.
                  Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=3.1 < 3.5", would install "3.5.2")
                  Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=3.1 < 3.5", would install "3.5.2").
Incompatible peer dependencies found.
Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together.
You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later.

I did a lot of weird stuff to get it working:

# uninstall build-angular and typescript
npm uninstall @angular-devkit/build-angular
npm uninstall typescript
# update all
ng update --all --allow-dirty
# install the needed typescript and build-angular
npm install @angular-devkit/build-angular
npm install --save typescript@3.4.5

Seems to work now. Compiles the bundles and starts de app.

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

This one worked for me! but something strange now in my package.json:

β€œ@angular-devkit/build-angular”: β€œ^0.800.3”,

Is this normal?