npm-watch: Not working on mac OS

Hello, I’m trying to use it on a mac but the script is not triggering the command when the watched files are modified. (I’ve tested the same configuration on a Ubuntu OS and is working correctly).

This is my configuration:

  "watch": {
    "compile-less": {
      "patterns": ["src/*"],
      "extensions": "less"
    }
  },
  "scripts": {
    "compile-less:watch": "npm-watch"
  }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 19 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I found I had to use the fuller watch like below for it to work for me:

"watch": {
"start": {
  "patterns": [
    "source"
  ],
  "extensions": "ts",
},

Something like the following would not work:

"local-start": "source/**/*.ts"

Further to this, I was getting EADDRINUSE errors every second or so restarts. I’m not sure what caused it. However I found that for my purposes, nodemon worked. It’s unfortunately not as flexible with possible (separate) configurations as npm-watch.

I have the same issue. 😦

{
  "watch": {
    "icons": "./img/icons/*.svg"
  },
  "scripts": {
    "icons": "svg-sprite --symbol --dest=./img --symbol-dest=. --symbol-sprite=icons.svg ./img/icons/*.svg",
    "watch": "npm-watch"
  }
}