Ionic 3 Project - Import and Build on another machine

Hi,
I have an Ionic 3 Project that contains this package.json

{
   "name": "XXX",
   "author": "XXX",
   "homepage": "http://ionicframework.com/",
   "private": true,
   "config": {
     "ionic_purge_unused_fonts": false,
     "ionic_copy": "./config/copy.config.js",
     "ionic_sass": "./config/sass.config.js",
     "custom_icons": "./config/custom-icons.config.js",
     "ionic_generate_source_map": "true"
   },
   "scripts": {
     "clean": "ionic-app-scripts clean",
     "build": "ionic-app-scripts build",
     "ionic:build": "ionic-app-scripts build",
     "ionic:serve": "ionic-app-scripts serve",
     "ionic:watch:before": "ionic2-custom-icons",
     "ionic:build:before": "ionic2-custom-icons"
   },
   "dependencies": {
     "@angular/animations": "^4.4.6",
     "@angular/common": "^4.4.6",
     "@angular/compiler": "^4.4.6",
     "@angular/compiler-cli": "^4.4.6",
     "@angular/core": "^4.4.6",
     "@angular/forms": "^4.4.6",
     "@angular/http": "^4.4.6",
     "@angular/platform-browser": "^4.4.6",
     "@angular/platform-browser-dynamic": "^4.4.6",
     "@angular/platform-server": "^4.4.6",
     "@angular/router": "^4.4.6",
     "@ionic-native/base64": "^4.3.2",
     "@ionic-native/camera": "^4.3.2",
     "@ionic-native/core": "^4.3.2",
     "@ionic-native/crop": "^4.3.2",
     "@ionic-native/http": "^4.3.2",
     "@ionic-native/network": "^3.14.0",
     "@ionic/storage": "2.0.0",
     "@ngx-translate/core": "^8.0.0",
     "@ngx-translate/http-loader": "^2.0.1",
     "angular2-moment": "^1.7.0",
     "angularfire2": "^5.0.0-rc.3",
     "com-badrit-base64": "^0.2.0",
     "cordova-android": "^7.1.1",
     "cordova-hot-code-push-cli": "^1.1.1",
     "cordova-hot-code-push-plugin": "^1.5.3",
     "cordova-plugin-advanced-http": "^1.11.1",
     "cordova-plugin-camera": "^2.4.1",
     "cordova-plugin-compat": "^1.2.0",
     "cordova-plugin-crop": "^0.4.0",
     "cordova-plugin-device": "^1.1.7",
     "cordova-plugin-file": "^6.0.1",
     "cordova-plugin-file-transfer": "^1.7.1",
     "cordova-plugin-network-information": "^1.3.4",
     "cordova-plugin-splashscreen": "^4.1.0",
     "cordova-plugin-statusbar": "^2.4.2",
     "cordova-plugin-whitelist": "^1.3.3",
     "cordova-sqlite-storage": "^2.4.0",
     "ionic-angular": "^3.9.2",
     "ionic-long-press": "^1.2.0",
     "ionic-native": "2.4.1",
     "ionic-plugin-keyboard": "^2.2.1",
     "ionic2-custom-icons": "^0.5.1",
     "ionicons": "3.0.0",
     "ng-pipes": "^0.1.2",
     "ng2-cache": "^0.1.6",
     "node-gyp": "^3.6.2",
     "rxjs": "5.0.0-beta.12",
     "sentry-cordova": "^0.12.2",
     "sw-toolbox": "3.4.0",
     "ttf2woff2": "^2.0.3",
     "typescript": "^2.5.3",
     "zone.js": "0.6.26"
   },
   "devDependencies": {
     "@ionic/app-scripts": "^3.1.7",
     "@ionic/cli-plugin-proxy": "1.5.7",
     "typescript": "2.0.9"
   },
   "cordovaPlugins": [
     "cordova-plugin-whitelist",
     "cordova-plugin-console",
     "cordova-plugin-statusbar",
     "cordova-plugin-device",
     "ionic-plugin-keyboard",
     "cordova-plugin-splashscreen"
   ],
   "cordovaPlatforms": [
     "ios",
     {
       "platform": "ios",
       "version": "",
       "locator": "ios"
     }
   ],
   "description": "XXX",
   "cordova": {
     "platforms": [
       "android"
     ],
     "plugins": {
       "cordova-plugin-device": {},
       "cordova-plugin-splashscreen": {},
       "cordova-plugin-statusbar": {},
       "cordova-plugin-whitelist": {},
       "cordova-sqlite-storage": {},
       "ionic-plugin-keyboard": {},
       "cordova-plugin-crop": {},
       "com-badrit-base64": {},
       "cordova-plugin-camera": {},
       "cordova-plugin-advanced-http": {},
       "cordova-plugin-network-information": {},
       "cordova-plugin-file-transfer": {},
       "cordova-plugin-file": {},
       "cordova-hot-code-push-plugin": {},
       "sentry-cordova": {}
     }
   }
 }

When i import the project on an other machine, and i execute the npm install there are not problems, but if i run the command

npm run build --prod

to execute a production build, i receive errors like this

@ionic-native/core/decorators.d.ts, found version 4, expected 3 error: metadata version mismatch for module

Why? What is the best way to import a project to another machine without problems? Why every time that i import a project on another computer i have to resolve problems?

Thanks.

Try upgrading this to a similar version to all the other @ionic-native packages.

What is your ionic info output?

I have solved with the update of all dependecies. Thanks.

1 Like