Spark323
Spark323

Reputation: 1585

Ionic 2 - watch failed: A watch configured to watch the following paths failed to start

I've been trying to get the Ionic watch to work, but I've been getting an error. I created a brand new app with the following command:

ionic start my-app --v2

This seems to work fine, then I try to serve the app

ionic serve -p $PORT

However, I get the following error

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) 

I can see that the src folder does exist in the path shown in the error. Is there a way I can resolve this error? I'm using the C9 IDE and installed Ionic with the following command

sudo npm install ionic cordova -g

Here is my package.json in case it is needed:

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

Upvotes: 0

Views: 3738

Answers (1)

bilel laho
bilel laho

Reputation: 11

I had the same error, I resolved it by deleting node_modules directory and run npm install

Upvotes: 1

Related Questions