Chart.js for ionic 3 version: Cannot find module “@angular/core/src/render3”

I added chartjs framework into my ionic 3 app. On windows/android, it works but if I try to build the app on mac platform I receive this error:

Cannot find module “@angular/core/src/render3”

ionic info


   ionic (Ionic CLI)  : 4.10.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.5
   @ionic/app-scripts : 3.2.2


   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 12 other plugins)


   Android SDK Tools : 26.1.1 (/Users/lsantaniello/Library/Android/sdk)
   ios-deploy        : 1.9.2
   ios-sim           : 6.1.2
   NodeJS            : v7.7.0 (/usr/local/bin/node)
   npm               : 4.1.2
   OS                : macOS High Sierra
   Xcode             : Xcode 10.1 Build version 10B61

Can you help me to solve the issue?

I tried to remove node_modules folder and rerun npm install but the problem is not solved.

Thanks in advance


Your Node.js version is very old please try to install v12.13.0.
Then remove and add node modules again.

Node updated but issue is not solved

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

rm -rf node_modules/

npm install

ionic cordova build ios --prod
[20:21:57]  ionic-app-script task: "build" 
[20:21:57]  Error: ./src/pages/profile/profile.ts Module not found: Error: Can't resolve '@angular/core/src/render3' in 
            '/Volumes/Data/projects/ionic3/nutrizionista/src/pages/profile' resolve '@angular/core/src/render3' in 
            '/Volumes/Data/projects/ionic3/nutrizionista/src/pages/profile' Parsed request is a module using description 
            file: /Volumes/Data/projects/ionic3/nutrizionista/package.json (relative path: ./src/pages/profile) Field 
            'browser' doesn't contain a valid alias configuration after using description file:

Not solved

Please post package.json and src/pages/profile.ts (especially the imports: don’t elide those). Incidentally, there is never any reason to run npm under sudo, and doing so can wreak massive havoc that is very hard to clean up.