无法运行ionic3应用程序 [英] Unable to run ionic3 application

查看:229
本文介绍了无法运行ionic3应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ionic3应用程序,并用npm install -g ionic cordova安装了ionic,但是当我用ionic serve运行该应用程序时,出现此错误:

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).

这是package.json

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"
  }

出什么问题了?那是因为我正在使用ionic4运行ionic3应用程序?我可以解决这个问题吗?

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

推荐答案

请删除您的节点模块文件夹

Please delete your node modules folder

从以下命令安装最新的应用程序脚本:

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

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

现在通过以下命令安装Node模块:

npm安装

npm install

立即尝试,它将为您提供帮助.

Try now, it will help you.

这篇关于无法运行ionic3应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆