Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find module @ionic/ng-toolkit after replacing with @ionic/angular-toolkit at build #3763

carstenbaumhoegger opened this issue Nov 27, 2018 · 3 comments


Copy link

@carstenbaumhoegger carstenbaumhoegger commented Nov 27, 2018

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

   ionic (Ionic CLI)             : 4.4.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.16
   @angular-devkit/build-angular : 0.10.7
   @angular-devkit/schematics    : 7.1.0
   @angular/cli                  : 7.1.0
   @ionic/angular-toolkit        : 1.2.0


   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.2, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 2.0.0, (and 11 other plugins)


   NodeJS : v10.13.0 (/usr/local/bin/node)
   npm    : 6.4.1
   OS     : macOS
   Xcode  : Xcode 10.1 Build version 10B61

Describe the Bug
Yesterday, I replaced @ionic/ng-toolkit and @ionic/schematics-angular with @ionic/angular-toolkit. When I serve the app, everything works as expected.
The problem occurs, when I build the App for iOS or Android at this step:
ng run app:ionic-cordova-build:production --platform=android

Steps to Reproduce
Steps to reproduce the behavior:

  1. Follow these upgrade instructions
  2. See the error when running ionic cordova build android --prod --release

Expected Behavior
The build works without problems as before.

Additional Context
List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, screenshots, OS if applicable, etc.


Could not find module "@ionic/ng-toolkit" from "/Users/carstenbaumhoegger/app".
Error: Could not find module "@ionic/ng-toolkit" from "/Users/carstenbaumhoegger/app".
    at Object.resolve (/Users/carstenbaumhoegger/app/node_modules/@angular-devkit/core/node/resolve.js:141:11)
    at Observable.rxjs_1.Observable [as _subscribe] (/Users/carstenbaumhoegger/app/node_modules/@angular/cli/node_modules/@angular-devkit/architect/src/architect.js:132:40)
    at Observable._trySubscribe (/Users/carstenbaumhoegger/app/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/Users/carstenbaumhoegger/app/node_modules/rxjs/internal/Observable.js:30:22)
    at /Users/carstenbaumhoegger/app/node_modules/rxjs/internal/Observable.js:99:19
    at new Promise (<anonymous>)
    at Observable.toPromise (/Users/carstenbaumhoegger/app/node_modules/rxjs/internal/Observable.js:97:16)
    at RunCommand.runSingleTarget (/Users/carstenbaumhoegger/app/node_modules/@angular/cli/models/architect-command.js:101:86)
    at RunCommand.runArchitectTarget (/Users/carstenbaumhoegger/app/node_modules/@angular/cli/models/architect-command.js:128:35)
    at (/Users/carstenbaumhoegger/app/node_modules/@angular/cli/commands/run-impl.js:14:25)
[ERROR] An error occurred while running subprocess ng.

This comment has been minimized.

Copy link

@carstenbaumhoegger carstenbaumhoegger commented Nov 27, 2018

I found the solution by myself shortly after posting this.

The builder-option in angular.json has to be changed from ng-toolkit to angular-toolkit.
It would be nice if you could add this to the upgrade instructions for people, that are upgrading an existing app.


This comment has been minimized.

Copy link

@abennouna abennouna commented Nov 27, 2018

When you use @ionic/angular-toolkit as a dependency, you also need to update angular.json by replacing all occurrences of @ionic/ng-toolkit and @ionic/schematics-angular by @ionic/angular-toolkit.

Starting from apps created with v4.0.0-beta.13, nothing to do.

@dwieeb dwieeb transferred this issue from ionic-team/ionic Nov 27, 2018
@ionitron-bot ionitron-bot bot added the triage label Nov 27, 2018

This comment has been minimized.

Copy link

@dwieeb dwieeb commented Nov 27, 2018

It would be nice if you could add this to the upgrade instructions for people, that are upgrading an existing app.

It should be documented at the bottom of the upgrade instructions you linked to (ionic-team/starters#487 (comment))

I realize upgrading apps is a little rocky, but we're still in beta and I hope to address changes like this using update schematics. See #3686.

@abennouna is correct. This is the fix. Unless I'm missing something, this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.