1

I have an ionic3 application and I installed ionic with npm install -g ionic cordova , but when I run the application with ionic serve, i get this error :

typescript error

[app-scripts]             Unknown compiler option 'resolveJsonModule'.

[app-scripts]             Unknown compiler option 'esModuleInterop'.

[app-scripts] [11:58:10]  typescript error
[app-scripts] [11:58:10]  ionic-app-script task: "serve"
[app-scripts] [11:58:10]  TypeError: Cannot read property 'replace' of null
[app-scripts] TypeError: Cannot read property 'replace' of null
[app-scripts]     at Object.escapeHtml 

 [ERROR] ionic-app-scripts has unexpectedly closed (exit code 1).

this is the package.json

   "scripts": {
   "start": "ionic-app-scripts serve",
   "clean": "ionic-app-scripts clean",
  "build": "ionic-app-scripts build",
   "lint": "ionic-app-scripts lint"
  }
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
   "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "~4.9.2",
   "@ionic-native/local-notifications": "^4.11.0",
   "@ionic-native/native-storage": "^4.10.0",
   "@ionic-native/splash-screen": "~4.9.2",
   "@ionic-native/status-bar": "~4.9.2",
   "@ionic/core": "^4.0.0-beta.12",
    "@ionic/pro": "1.0.20",
   "@ionic/storage": "2.1.3",
    "angular": "^1.7.5",
    "chart.js": "^2.7.2",
   "cordova-android": "7.0.0",
    "cordova-browser": "^5.0.4",
    "cordova-ios": "4.5.5",
   "cordova-plugin-device": "^2.0.2",
  "cordova-plugin-ionic-keyboard": "^2.0.5",
   "cordova-plugin-ionic-webview": "^1.1.19",
   "cordova-plugin-local-notification": "^0.9.0-beta.2",
    "cordova-plugin-splashscreen": "^5.0.2",
   "cordova-plugin-whitelist": "^1.3.3",
    "crypto-js": "^3.1.9-1",
   "ionic": "^4.2.1",
    "ionic-angular": "3.9.2",
   "ionicons": "3.0.0",
   "rxjs": "5.5.11",
   "sw-toolbox": "3.6.0",
   "zone.js": "0.8.26"
  },
 "devDependencies": {
    "@ionic/app-scripts": "3.1.11",
    "typescript": "~2.6.2"
  }

What is the problem ? In that because I m using ionic4 to run an ionic3 application ? and haw can I fix that ?

1
  • Can you update your question with scripts attribute of package.json Commented Oct 14, 2018 at 12:04

2 Answers 2

3

Please delete your node modules folder

Install latest app script from below command:

npm install @ionic/app-scripts@latest --save-dev

Now install Node modules by below command:

npm install

Try now, it will help you.

Sign up to request clarification or add additional context in comments.

Comments

0

Try running follows,

npm uninstall @ionic/app-scripts --save-dev

npm install @ionic/app-scripts@latest --save-dev

After that run ionic serve

1 Comment

It is always the same error, when I try to run the application with ' cordova run ' it works but I can't understand why it doesn't run with ' ionic serve '

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.