我有同樣的問題,並找到幾個解決方案。以下是爲我工作:
爲了使生活與> 0.29反應母語版本
- 重裝轉到文件:
yourProjectFolder//node_modules/react-native/local-cli/server/server.js
- 讚許線(62) :process.exit(11) - > //process.exit(11)
關於第2點:我不知道從什麼時候開始2.1的解決方案。是需要的,但我認爲〜反應本機v.33。如果有人確切地知道,請糾正這一點你只要看看是否在2.或2.1處找到了index.js。路徑。
2.1(的舊路徑陣營本地FileWatcher index.js)轉到文件:yourProjectFolder//node_modules/react-native/node_modules\node-haste\lib\FileWatcher\index.js"
2.2(較新的陣營,本土FileWatcher index.js路徑)轉到文件: yourProjectFolder\node_modules\react-native\packager\react-packager\src\node-haste\FileWatcher\index.js
STEP 1爲2.1 + 2.2:
Increase
在index.js
文件的頂部:MAX_WAIT_TIME=120000
>MAX_WAIT_TIME=360000
- 更改
function (_createWatcher)
到:
STEP 2爲2.1(舊版路徑index.js)
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);
});
});
}
STEP 2 2.2(index.js的較新的路徑)
_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);
});
});
}
該解決方案爲我工作。希望如果我錯了,我可以幫助你並糾正我。
謝謝你的回答。我做了你在2.1中寫的東西,但不幸在'myProjectFolder/node_modules/react-native/local-cli/server/server.js'中找不到'process.exit(1)'這一行。我正在使用'react-native version 0.35.0' – krzyhub
星期二我回來了,我可以看看它。 –
你很親切。感謝您的倡議。直到這個時候,我會努力克服這個問題。如果我能找到解決方案,我會在這裏分享。 – krzyhub