离子2 - 观看失败:配置为观看以下路径的手表无法启动

问题描述 投票:0回答:1

我一直试图让Ionic watch工作,但我一直在收到错误。我使用以下命令创建了一个全新的应用程序:

ionic start my-app --v2

这似乎工作正常,然后我尝试提供应用程序

ionic serve -p $PORT

但是,我收到以下错误

watch failed: A watch configured to watch the following paths failed to start. It likely that a file 
        referenced does not exist: /home/ubuntu/workspace/my-app/src/**/*.(ts|html|s(c|a)ss) 

我可以看到src文件夹确实存在于错误中显示的路径中。有没有办法可以解决这个错误?我正在使用C9 IDE并使用以下命令安装Ionic

sudo npm install ionic cordova -g

这是我的package.json,以防需要:

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "2.4.8",
    "@angular/compiler": "2.4.8",
    "@angular/compiler-cli": "2.4.8",
    "@angular/core": "2.4.8",
    "@angular/forms": "2.4.8",
    "@angular/http": "2.4.8",
    "@angular/platform-browser": "2.4.8",
    "@angular/platform-browser-dynamic": "2.4.8",
    "@angular/platform-server": "2.4.8",
    "@ionic-native/core": "3.1.0",
    "@ionic-native/splash-screen": "3.1.0",
    "@ionic-native/status-bar": "3.1.0",
    "@ionic/storage": "2.0.0",
    "ionic-angular": "2.2.0",
    "ionicons": "3.0.0",
    "rxjs": "5.0.1",
    "sw-toolbox": "3.4.0",
    "zone.js": "0.7.2"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.1.4",
    "typescript": "2.0.9"
  },
  "cordovaPlugins": [
    "cordova-plugin-whitelist",
    "cordova-plugin-statusbar",
    "cordova-plugin-console",
    "cordova-plugin-device",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [],
  "description": "my-app: An Ionic project"
}
ionic-framework ionic2
1个回答
0
投票

我有同样的错误,我通过删除node_modules目录解决它并运行npm install

© www.soinside.com 2019 - 2024. All rights reserved.