Package build error on Pro: Cannot find module '@ionic/ng-toolkit/package'

I have a package build setup on Pro for a very simple test app. In the build log there are two errors:

[ERROR] Error loading @ionic/schematics-angular package.json: Error: Cannot find module ‘@ionic/schematics-angular/package’
[ERROR] Error loading @ionic/ng-toolkit package.json: Error: Cannot find module ‘@ionic/ng-toolkit/package’

I searched the whole project folder and did not find any “ng-toolkit”. And from npm I know this package is deprecated and is changed to @ionic/angular-toolkit.

I suspect this caused the issue that when I tested my app to access fingerprint or camera on my iPhone 6, it always showed an error of cordova_not_available.

Also the log shows that it’s using quite old version of NodeJS and npm.

image

I think that ng-toolkit as been deprecated in favor of angular-toolkit (I guess you have a Ionic Angular app)

That’s maybe the problem?

Try the following: create on the side a dummy app (ionic start --type=angular) and then compare your libs with the current state of the libs aka compare your package.json with the dummy package.json, maybe you will find that difference. There “force” a clean install in your project (remove package-lock and node_modules and install again)

Thanks @reedirichards for your reply. Yes it’s a Ionic 4 Angular app and I have tried what you have suggested but it’s still the same.

Submitted a Ionic Pro support form 3 days ago and received an email with following texts:

“…The Ionic offices are currently closed for the Labor Day holiday. We will reopen at 9:00 AM CDT(UTC -5) on Tuesday, September 4th. …”

could you display your package.json plz

@reedrichards here it is:

{
“name”: “app”,
“version”: “0.0.1”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“scripts”: {
“ng”: “ng”,
“start”: “ng serve”,
“build”: “ng build”,
“test”: “ng test”,
“lint”: “ng lint”,
“e2e”: “ng e2e”
},
“private”: true,
“dependencies”: {
@angular/common”: “~7.0.0”,
@angular/core”: “~7.0.0”,
@angular/forms”: “~7.0.0”,
@angular/http”: “~7.0.0”,
@angular/platform-browser”: “~7.0.0”,
@angular/platform-browser-dynamic”: “~7.0.0”,
@angular/router”: “~7.0.0”,
@ionic-native/camera”: “5.0.0-beta.21”,
@ionic-native/core”: “5.0.0-beta.21”,
@ionic-native/fingerprint-aio”: “5.0.0-beta.21”,
@ionic-native/splash-screen”: “5.0.0-beta.21”,
@ionic-native/status-bar”: “5.0.0-beta.21”,
@ionic/angular”: “4.0.0-beta.16”,
“cordova-plugin-camera”: “4.0.3”,
“cordova-plugin-fingerprint-aio”: “1.5.0”,
“core-js”: “^2.5.4”,
“rxjs”: “~6.3.3”,
“zone.js”: “~0.8.26”
},
“devDependencies”: {
@angular-devkit/architect”: “~0.10.0”,
@angular-devkit/build-angular”: “~0.10.0”,
@angular-devkit/core”: “~7.0.0”,
@angular-devkit/schematics”: “~7.0.0”,
@angular/cli”: “~7.0.0”,
@angular/compiler”: “~7.0.0”,
@angular/compiler-cli”: “~7.0.0”,
@angular/language-service”: “~7.0.0”,
@ionic/angular-toolkit”: “~1.2.0”,
@types/jasmine”: “~2.8.8”,
@types/jasminewd2”: “~2.0.3”,
@types/node”: “~10.12.0”,
“codelyzer”: “~4.5.0”,
“jasmine-core”: “~2.99.1”,
“jasmine-spec-reporter”: “~4.2.1”,
“karma”: “~3.0.0”,
“karma-chrome-launcher”: “~2.2.0”,
“karma-coverage-istanbul-reporter”: “~2.0.1”,
“karma-jasmine”: “~1.1.2”,
“karma-jasmine-html-reporter”: “^0.2.2”,
“protractor”: “~5.4.0”,
“ts-node”: “~7.0.0”,
“tslint”: “~5.11.0”,
“typescript”: “~3.1.6”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“cordova-plugin-fingerprint-aio”: {},
“cordova-plugin-camera”: {}
}
}
}

have you removed package-lock and node_modules and reinstalled everything?
what’s the error now? can’t be ng-toolkit anymore since you don’t reference it

Yes did that exactly. I suspect there is something wrong with the pro build environment. Here is the screenshot of the build log:

effectively something weird if it compiles correctly locally but doesn’t remotely

I am trying to set up a local Mac OS environment to see what happens. If it proves it’s the Ionic Pro build environment then I don’t see why I should keep my Ionic Pro paid service.

let me know what happens locally

why jumping to such a conclusion? you contacted the support, they gonna answer after their holidays

@reedrichards Not sure if you have read my post carefully, it says it will reopen on September 4th… lol

Lol yep that’s a while ago :wink:

To which email did you write?

@reedrichards, I have set up a virtualbox with Mac OS, and can confirm it built successfully without the ng-toolkit error.

Are you able to help to look at two issues with the Pro build environment?

  • @ionic/ng-toolkit error
  • NodeJS is an old version

Thanks.

Unfortunately can’t help more, I don’t use pro

Sorry I thought you are from Ionic. Thanks for trying to help.

Haha no at all :wink:

You didn’t answered my last question, from curiosity, to which support email address did you write to? maybe its just inactive and they are using a new one?