回答我自己的问题。 This post帮了我。
在这个文件中\ node_modules \反应母语\ node_modules \节点匆忙\ LIB \ FileWatcher \ index.js
- 我不得不增加
MAX_WAIT_TIME
(我我从120000改为360000)。
- 也不得不改变
这
key: '_createWatcher',
value: function _createWatcher(rootConfig) {
var watcher = new WatcherClass(rootConfig.dir, {
glob: rootConfig.globs,
dot: false
});
return new Promise(function (resolve, reject) {
var rejectTimeout = setTimeout(function() {
return reject(new Error(timeoutMessage(WatcherClass)));
}, MAX_WAIT_TIME);
watcher.once('ready', function() {
clearTimeout(rejectTimeout);
resolve(watcher);
});
});
}
到
key: '_createWatcher',
value: function _createWatcher(rootConfig) {
var watcher = new WatcherClass(rootConfig.dir, {
glob: rootConfig.globs,
dot: false
});
return new Promise(function (resolve, reject) {
const rejectTimeout = setTimeout(function() {
reject(new Error([
'Watcher took too long to load',
'Try running `watchman version` from your terminal',
'https://facebook.github.io/watchman/docs/troubleshooting.html',
].join('\n')));
}, MAX_WAIT_TIME);
watcher.once('ready', function() {
clearTimeout(rejectTimeout);
resolve(watcher);
});
});
}
现在这个更改后,改动任何代码我做,我甚至不具备按R键两次它会自动更改。我希望这可以帮助像我这样的菜鸟。谢谢。