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

时间:2017-03-21 22:14:07

标签: ionic-framework ionic2

我一直试图让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"
}

1 个答案:

答案 0 :(得分:0)

我遇到了同样的错误,我通过删除node_modules目录并运行npm install

解决了这个错误