Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Packager] Error: Watcher took too long to load #2032

Closed
wanghaisheng opened this issue Jul 17, 2015 · 29 comments
Closed

[Packager] Error: Watcher took too long to load #2032

wanghaisheng opened this issue Jul 17, 2015 · 29 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@wanghaisheng
Copy link

solution in https://facebook.github.io/watchman/docs/troubleshooting.html does not work
node -v
v2.3.4

edwin@192.168.0.112:/Users/edwin/Documents/workfolder/workspace/ReactNative-PropertyFinder  git:(master*) $ npm start                   

> PropertyFinder@0.0.1 start /Users/edwin/Documents/workfolder/workspace/ReactNative-PropertyFinder
> node_modules/react-native/packager/packager.sh


 ===============================================================
 |  Running packager on port 8081.       
 |  Keep this packager running while developing on any JS         
 |  projects. Feel free to close this tab and run your own      
 |  packager instance if you prefer.                              
 |                                                              
 |     https://github.com/facebook/react-native                 
 |                                                              
 ===============================================================

Looking for JS files in
   /Users/edwin/Documents/workfolder/workspace/ReactNative-PropertyFinder 


React packager ready.

[00:18:06] <START> fs crawl
[00:18:08] <END>   fs crawl (1954ms)
 ERROR  Watcher took too long to load
Try running `watchman version` from your terminal
https://facebook.github.io/watchman/docs/troubleshooting.html
Error: Watcher took too long to load
Try running `watchman version` from your terminal
https://facebook.github.io/watchman/docs/troubleshooting.html
    at [object Object]._onTimeout (/Users/edwin/Documents/workfolder/workspace/ReactNative-PropertyFinder/node_modules/react-native/packager/react-packager/src/FileWatcher/index.js:98:16)
    at Timer.listOnTimeout (timers.js:89:15)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.

npm ERR! Darwin 14.4.0
npm ERR! argv "/Users/edwin/.nvm/versions/io.js/v2.3.4/bin/iojs" "/Users/edwin/.nvm/versions/io.js/v2.3.4/bin/npm" "start"
npm ERR! node v2.3.4
npm ERR! npm  v2.12.1
npm ERR! code ELIFECYCLE
npm ERR! PropertyFinder@0.0.1 start: `node_modules/react-native/packager/packager.sh`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the PropertyFinder@0.0.1 start script 'node_modules/react-native/packager/packager.sh'.
npm ERR! This is most likely a problem with the PropertyFinder package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node_modules/react-native/packager/packager.sh
npm ERR! You can get their info via:
npm ERR!     npm owner ls PropertyFinder
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/edwin/Documents/workfolder/workspace/ReactNative-PropertyFinder/npm-debug.log

@arypurnomoz
Copy link

+1

@brentvatne
Copy link
Collaborator

Try out some of these solutions, and let us know if one works so we can update the docs! Or if you're up to it, feel free to update them yourself and submit a PR!

#1991
#1920
#910
#20

If those don't work, try uninstalling node and watchman via homebrew, and install nvm and then use nvm to install iojs, then reinstall watchman and try again.

Ping me if none of the above solves your problem and we can re-open this and look into it further! 😄

@wanghaisheng
Copy link
Author

@brentvatne yeah I have tried the solution you mentioned before i post this issue.

@brentvatne
Copy link
Collaborator

@wanghaisheng - you tried all of those solutions? What OS version are you using?

@wanghaisheng
Copy link
Author

yeah, it takes my whole last weekend though
@brentvatne OSX 10.10.4
npm -v
2.12.1

@brentvatne
Copy link
Collaborator

:(

@brentvatne brentvatne reopened this Jul 22, 2015
@brentvatne
Copy link
Collaborator

@wanghaisheng - does this happen when you just create a new project with react-native init SomeProjectName ? Maybe this is somehow related to the PropertyFinder app mentioned above (iirc it's from a very early tutorial) being on an older version

@wanghaisheng
Copy link
Author

@brentvatne no . not intend to init some project until now.

edwin@edwindeMacBook-Pro.local:/Users/edwin/workspace  $ react-native init  test1
This will walk you through creating a new React Native project in /Users/edwin/Documents/workfolder/workspace/test1
npm WARN engine stacktrace-parser@0.1.1: wanted: {"node":"~0.10"} (current: {"node":"2.3.4","npm":"2.12.1"})

> ws@0.4.31 install /Users/edwin/Documents/workfolder/workspace/test1/node_modules/react-native/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o

> fsevents@0.3.6 install /Users/edwin/Documents/workfolder/workspace/test1/node_modules/react-native/node_modules/babel/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

2015-07-22 13:13:32.382 xcodebuild[39305:1493259] error: (null)
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from /usr/include/dispatch/dispatch.h:51:0,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55,
                 from ../fsevents.cc:10:
/usr/include/dispatch/object.h:143:15: error: expected unqualified-id before '^' token
 typedef void (^dispatch_block_t)(void);
               ^
/usr/include/dispatch/object.h:143:15: error: expected ')' before '^' token
/usr/include/dispatch/object.h:362:3: error: 'dispatch_block_t' has not been declared
   dispatch_block_t notification_block);
   ^
In file included from /usr/include/Availability.h:153:0,
                 from /usr/include/sys/stat.h:75,
                 from /Users/edwin/.node-gyp/2.3.4/deps/uv/include/uv-unix.h:26,
                 from /Users/edwin/.node-gyp/2.3.4/deps/uv/include/uv.h:61,
                 from ../node_modules/nan/nan.h:23,
                 from ../fsevents.cc:6:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:262:38: error: expected '}' before '__attribute__'
   kFSEventStreamCreateFlagIgnoreSelf __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_6_0) = 0x00000008,
                                      ^
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55:0,
                 from ../fsevents.cc:11:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:262:89: error: expected unqualified-id before '=' token
   kFSEventStreamCreateFlagIgnoreSelf __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_6_0) = 0x00000008,
                                                                                         ^
In file included from /usr/include/Availability.h:153:0,
                 from /usr/include/sys/stat.h:75,
                 from /Users/edwin/.node-gyp/2.3.4/deps/uv/include/uv-unix.h:26,
                 from /Users/edwin/.node-gyp/2.3.4/deps/uv/include/uv.h:61,
                 from ../node_modules/nan/nan.h:23,
                 from ../fsevents.cc:6:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:414:38: error: expected '}' before '__attribute__'
   kFSEventStreamEventFlagItemCreated __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_6_0) = 0x00000100,
                                      ^
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:55:0,
                 from ../fsevents.cc:11:
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:414:89: error: expected unqualified-id before '=' token
   kFSEventStreamEventFlagItemCreated __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_6_0) = 0x00000100,
                                                                                         ^
/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:493:1: error: expected declaration before '}' token
 };
 ^
make: *** [Release/obj.target/fse/fsevents.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "/usr/local/Cellar/iojs/2.3.4/bin/iojs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/edwin/Documents/workfolder/workspace/test1/node_modules/react-native/node_modules/babel/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v2.3.4
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing fsevents@0.3.6
react-native@0.7.1 node_modules/react-native
├── absolute-path@0.0.0
├── stacktrace-parser@0.1.1
├── graceful-fs@3.0.8
├── react-timer-mixin@0.13.2
├── underscore@1.7.0
├── image-size@0.3.5
├── yargs@1.3.2
├── bluebird@2.9.34
├── source-map@0.1.31 (amdefine@1.0.0)
├── rebound@0.0.12
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── debug@2.1.3 (ms@0.7.0)
├── promise@7.0.3 (asap@2.0.3)
├── worker-farm@1.3.1 (xtend@4.0.0, errno@0.1.3)
├── uglify-js@2.4.23 (uglify-to-browserify@1.0.2, async@0.2.10, source-map@0.1.34, yargs@3.5.4)
├── ws@0.4.31 (tinycolor@0.0.1, options@0.0.6, commander@0.6.1, nan@0.3.2)
├── module-deps@3.5.6 (inherits@2.0.1, shallow-copy@0.0.1, duplexer2@0.0.2, minimist@0.2.0, subarg@0.0.1, resolve@0.7.4, parents@1.0.1, readable-stream@1.1.13, through2@0.4.2, stream-combiner2@1.0.2, JSONStream@0.7.4, concat-stream@1.4.10, browser-resolve@1.9.0, detective@3.1.0)
├── joi@5.1.0 (topo@1.0.2, isemail@1.1.1, hoek@2.14.0, moment@2.10.3)
├── sane@1.1.3 (watch@0.10.0, minimist@1.1.1, minimatch@0.2.14, exec-sh@0.2.0, fb-watchman@1.2.0, walker@1.0.7)
├── jstransform@11.0.1 (object-assign@2.1.1, base62@1.1.0, esprima-fb@15001.1.0-dev-harmony-fb, source-map@0.4.4, commoner@0.10.3)
├── react-tools@0.13.2 (jstransform@10.1.0, commoner@0.10.3)
├── chalk@1.1.0 (escape-string-regexp@1.0.3, supports-color@2.0.0, ansi-styles@2.1.0, strip-ansi@3.0.0, has-ansi@2.0.0)
├── babel@5.4.3 (slash@1.0.0, path-is-absolute@1.0.0, fs-readdir-recursive@0.1.2, convert-source-map@1.1.1, source-map@0.4.4, lodash@3.10.0, commander@2.8.1, output-file-sync@1.1.1, glob@5.0.14, chokidar@1.0.5)
├── babel-core@5.8.3 (slash@1.0.0, trim-right@1.0.1, to-fast-properties@1.0.1, path-is-absolute@1.0.0, shebang-regex@1.0.0, fs-readdir-recursive@0.1.2, babel-plugin-remove-debugger@1.0.1, babel-plugin-remove-console@1.0.1, babel-plugin-property-literals@1.0.1, babel-plugin-jscript@1.0.1, babel-plugin-inline-environment-variables@1.0.1, babel-plugin-eval@1.0.1, babel-plugin-undefined-to-void@1.1.6, babel-plugin-member-expression-literals@1.0.1, babel-plugin-react-constant-elements@1.0.3, babel-plugin-react-display-name@1.0.3, path-exists@1.0.0, babel-plugin-constant-folding@1.0.1, babel-plugin-proto-to-assign@1.0.3, babel-plugin-dead-code-elimination@1.0.2, strip-json-comments@1.0.2, babel-plugin-runtime@1.0.7, private@0.1.6, globals@6.4.1, esutils@2.0.2, convert-source-map@1.1.1, js-tokens@1.0.1, babylon@5.8.3, line-numbers@0.2.0, source-map@0.4.4, minimatch@2.0.9, detect-indent@3.0.1, babel-plugin-undeclared-variables-check@1.0.2, resolve@1.1.6, output-file-sync@1.1.1, source-map-support@0.2.10, lodash@3.10.0, home-or-tmp@1.0.0, core-js@0.9.18, regexpu@1.2.0, repeating@1.1.3, is-integer@1.0.4, regenerator@0.8.34)
└── connect@2.8.3 (methods@0.0.1, uid2@0.0.2, fresh@0.1.0, cookie-signature@1.0.1, pause@0.0.1, qs@0.6.5, bytes@0.2.0, buffer-crc32@0.2.1, cookie@0.1.0, formidable@1.0.14, send@0.1.2)
Setting up new React Native app in /Users/edwin/Documents/workfolder/workspace/test1
Next Steps:
   Open /Users/edwin/Documents/workfolder/workspace/test1/test1.xcodeproj in Xcode
   Hit Run button

@brentvatne
Copy link
Collaborator

@wanghaisheng
Copy link
Author

@brentvatne gcc version is different.for installing watchman,I have manually installed latest version gcc on osx10.10.4 because there is no default installation with Xcode
facebook/watchman#120

@broonage
Copy link

Hi guys,

I'm a +1. I've followed all the solutions (uninstall, chmod rights, removing launchagents etc), the official troubleshooting solution, and still getting the timeout error.

Here's the log:

2015-07-22T14:00:03,546: [listener] Using watcher mechanism fsevents
2015-07-22T14:00:03,547: [listener] file limit is 256 kern.maxfilesperproc=10240
2015-07-22T14:00:03,547: [listener] raised file limit to 10240
2015-07-22T14:00:03,547: [listener] Using socket from launchd as listening socket
2015-07-22T14:00:03,547: [listener] failed to parse json from /usr/local/Cellar/watchman/HEAD/var/run/watchman/broonage.state: unable to open /usr/local/Cellar/watchman/HEAD/var/run/watchman/broonage.state: No such file or directory
2015-07-22T14:00:57,412: [client:fd=4] path /Users/broonage is on filesystem type hfs
2015-07-22T14:04:54,395: [client:fd=4] resolve_root: path "" must be absolute
2015-07-22T14:04:54,407: [client:fd=9] resolve_root: path "" must be absolute
2015-07-22T14:12:50,971: [client:fd=4] resolve_root: path "" must be absolute
2015-07-22T14:12:50,975: [client:fd=9] resolve_root: path "" must be absolute
2015-07-22T14:17:32,013: [client:fd=4] resolve_root: path "" must be absolute
2015-07-22T14:17:32,032: [client:fd=9] resolve_root: path "" must be absolute

@brentvatne brentvatne changed the title Error: Watcher took too long to load [Packager] Error: Watcher took too long to load Jul 22, 2015
@broonage
Copy link

Sorry brent, i wasn't sure if i should create a new issue or not.
Any ideas what's going on?

@brentvatne
Copy link
Collaborator

That's okay @broonage! Unfortunately I haven't had much luck resolving this for people myself, @mattmo did a good job of it though

@mattmo
Copy link

mattmo commented Jul 22, 2015

Sorry to be late to this. Could you provide the following details:

  1. your watchman version
  2. how you installed watchman
  3. what you mean by "I have manually installed latest version gcc"

@shayne
Copy link
Contributor

shayne commented Jul 22, 2015

Is the React Native project director a git repository? See: #2042

If it's not... run git init from your project directory and then npm start. It should no longer report the error.

@wanghaisheng
Copy link
Author

@mattmo
$ watchman -v
3.5.0

steps are here
$ brew update
$ brew install --HEAD watchman
but there was a compile error ,fix through the following


brew install homebrew/versions/gcc5
brew link gcc

ln -sf /usr/local/Cellar/gcc/5.2.0/bin/gcc-5 /usr/local/Cellar/gcc/5.2.0/bin/gcc
ln -sf /usr/local/Cellar/gcc/5.2.0/bin/g++-5 /usr/local/Cellar/gcc/5.2.0/bin/g++
ln -sf /usr/local/Cellar/gcc/5.2.0/bin/c++-5 /usr/local/Cellar/gcc/5.2.0/bin/c++
ln -sf /usr/local/Cellar/gcc/5.2.0/bin/cpp-5 /usr/local/Cellar/gcc/5.2.0/bin/cpp
ln -sf /usr/local/Cellar/gcc/5.2.0/bin/gfortran-5 /usr/local/Cellar/gcc/5.2.0/bin/gfortran

add the following to ~/.zshrc

export PATH=/usr/local/Cellar/gcc/5.2.0/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/Cellar/gcc/5.2.0/lib/gcc/5:$DYLD_LIBRARY_PATH

@wanghaisheng
Copy link
Author

@shayne yeah it is a git repository

@broonage
Copy link

@shayne, that fixed it! Able to edit and refresh the index js file!
Thanks guys.

@wanghaisheng
Copy link
Author

thx for all of u .
I figure out it temporally because of watchman,
when I uninstall the 3.5.0 version and brew install the 3.3.0 version ,the error is missing.

@mattmo
Copy link

mattmo commented Jul 23, 2015

Glad you were able to figure it out

@akshatpaul
Copy link

@shayne I am splitting my head for last 4 hrs on this issue - thank you so much for the solution 👍 you are awesome

@kyle-ssg
Copy link

kyle-ssg commented Sep 7, 2015

Same as above, thanks @shayne.

@olivierlesnicki
Copy link

@shayne good job on finding out this solution

@skunkworker
Copy link

@shayne +1 for git init inside of the project folder, it fixed my errors as well. I'm on watchman 4.1.0 and npm 3.3.12. Shouldn't a hard dependency on the folder being a git repo be an issue?

@tiansiyuan
Copy link

npm start failed

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! Finance@0.0.1 start: `node node_modules/react-native/local-cli/cli.js start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Finance@0.0.1 start script 'node node_modules/react-native/local-cli/cli.js start'.
npm ERR! This is most likely a problem with the Finance package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/react-native/local-cli/cli.js start
npm ERR! You can get their info via:
npm ERR!     npm owner ls Finance
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tiansiyuan/Documents/projects/FinanceReactNative/npm-debug.log

@bh1270
Copy link

bh1270 commented Jul 1, 2016

@tiansiyuan have you fix it ?

@anil826
Copy link

anil826 commented Dec 5, 2016

have you fixed it

@zetaoWu
Copy link

zetaoWu commented Jan 4, 2017

have you fix it ? @hubei1234 @tiansiyuan

@RajanJS
Copy link

RajanJS commented Jan 30, 2017

this solution worked for me,

brew uninstall watchman
sudo chown -R whoami /usr/local
brew unlink pcre && brew link pcre
brew install watchman

Thanks

@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests