How can i stop node installing on every opening? Glitch.com

644 views Asked by At
Initializing node_modules, hold on...
node v12.0.0, with pnpm
Installing...
Performing headless installation
Resolving: total 1, reused 0, downloaded 0
Resolving: total 1, reused 0, downloaded 0
Packages: +85
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Resolving: total 85, reused 84, downloaded 1
Resolving: total 85, reused 84, downloaded 1, done
dependencies:
+ discord.js 11.4.2
+ dotenv 8.2.0
+ express 4.17.1
+ rgb-hex 3.0.0
+ util 0.12.3
Total install time: 3722ms

My app's node is always installing again himself in every opening. And my app would closed a few minutes later. How can i stop this installing in every opening?

1

There are 1 answers

10
Jose Vasquez On

Answer

To stop auto-installing and restarting every time you change something in a file, you've got to create a file named as watch.json.

Examples

First of all create the watch.json at root level. Throttle time specifies the time to wait after a change began

Disable auto-restart on your whole project

{
  "install": {
    "include": [
      "^.trigger-rebuild$"
    ]
  },
  "throttle": 100
}

Disable auto-restart on public directory and restart on changes with .js files

{
  "install": {
    "include": [
      "^\\.env$"
    ]
  },
  "restart": {
    "exclude": [
      "^public/"
    ],
    "include": [
      "\\.js$"
    ]
  },
  "throttle": 100
}

Reference

watch.json example