react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[Packager] InternalError when run the initial project created by react-native-cli

Open foolyoghurt opened this issue 11 years ago • 18 comments

When I used react-native-cli to create my first react-native project and run it in XCode. It just failed and showed some errors.

Error messages shown in terminal:

[01:21:41] <START> fs crawl
Error: failed to parse query: must use ["allof", expr...]
    at BunserBuf.<anonymous> (/Users/Song/tmp/Awesome/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:93:23)
    at emitOne (events.js:77:13)
    at BunserBuf.emit (events.js:169:7)
    at BunserBuf.process (/Users/Song/tmp/Awesome/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/bser.js:289:10)
    at /Users/Song/tmp/Awesome/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/bser.js:244:12
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)

Environment

iojs 3.0.0 Xcode Version 6.4 (6E35b) watchman 3.3.0

foolyoghurt avatar Aug 15 '15 17:08 foolyoghurt

Having the same problem. I tried updating watchman to the HEAD version but didn't fix. When I brew uninstall watchman I get

<START> fs crawl
<END>   fs crawl (2903ms)

but with watchman installed, it hangs forever on

<START> fs crawl

and I get the same issue as @foolyoghurt

MatApple avatar Aug 17 '15 04:08 MatApple

If I change the react-native version to 0.6.0(now I use 0.9.0) in package.json and delete node_modules to rerun npm install, it works. However, cmd + R doesn't refresh as expected.

foolyoghurt avatar Aug 17 '15 06:08 foolyoghurt

I have the same issue. It seems is related with https://github.com/facebook/watchman/issues/134.

AbrahamAlcaina avatar Aug 17 '15 12:08 AbrahamAlcaina

Moving project out of my Dropbox folder resolves the issue for me.

MatApple avatar Aug 17 '15 19:08 MatApple

@AbrahamAlcaina I update the latest watchman but it still doesn't, now I just use nodemon -e js -x "npm start" to restart the service when some javascript file changes.

foolyoghurt avatar Aug 20 '15 17:08 foolyoghurt

I solved It doing a downgrade of iojs from 3.0 to 2.5.

AbrahamAlcaina avatar Aug 20 '15 17:08 AbrahamAlcaina

Was having the same issue. I uninstalled watchman & installed it again.

Emibob avatar Aug 29 '15 19:08 Emibob

I've downgraded iojs from 3.0 to 2.4 and reinstall the lastest watchman, but it still doesn't work. There seems to have some problem with watchman, but I don't know why Facebook can not fix this problem and why they use watchman(I find so many errors related to watchman when I use google)

foolyoghurt avatar Sep 01 '15 07:09 foolyoghurt

@foolyoghurt - watchman is well suited for Facebook's needs internally but maybe not always the best for oss users :(

When you install watchman, try installing from head: brew uninstall watchman && brew install watchman --HEAD

brentvatne avatar Sep 13 '15 21:09 brentvatne

I had this problem when trying to run a new React Native app. @brentvatne helped me on Slack.

Installing watchman using brew, even when using --HEAD flag, installed 3.7.0. Our conversation led me to think that there was 3.8.0 on Homebrew at one point, but it's been fudged with.

What I ended up doing was go to install watchman from source after checking out 3.8.0: https://facebook.github.io/watchman/docs/install.html

I'm running on Node 4.1.0, NPM 2.14.3, Yosemite.

Edit --

Cmd+R wasn't working, so I've unlinked everything for 3.8.0 that I made locally. I did brew install watchman --HEAD, and it installed 3.8.0 today.

Still getting an error:

[2:08:55 PM] <START> Building Dependency Graph
[2:08:55 PM] <START> Crawling File System
Error: failed to parse query: must use ["allof", expr...]
    at BunserBuf.<anonymous> (/Users/drew/Projects/Mob/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:93:23)
    at emitOne (events.js:77:13)
    at BunserBuf.emit (events.js:169:7)
    at BunserBuf.process (/Users/drew/Projects/Mob/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/node_modules/bser/index.js:289:10)
    at /Users/drew/Projects/Mob/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/node_modules/bser/index.js:244:12
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)
[2:11:00 PM] <START> request:/index.ios.bundle
[2:11:00 PM] <START> find dependencies

Watchman outputs:

Andrews-MacBook-Pro:Mob drew$ watchman watch .
{
    "version": "3.8.0",
    "watch": "/Users/Drew/Projects/Mob"
}
Andrews-MacBook-Pro:Mob drew$ watchman watch-list
{
    "version": "3.8.0",
    "roots": [
        "/Users/Drew/Projects/Mob"
    ]
}
  501 21500     1   0  2:08PM ??         0:00.41 /usr/local/bin/watchman --foreground --logfile=/usr/local/Cellar/watchman/HEAD/var/run/watchman/drew-state/log --log-level=1 --sockname=/usr/local/Cellar/watchman/HEAD/var/run/watchman/drew-state/sock --statefile=/usr/local/Cellar/watchman/HEAD/var/run/watchman/drew-state/state

dzjin avatar Sep 19 '15 00:09 dzjin

I was encountering this same issue with react-native 0.11.0 and node 4.1.0. I tried all the solutions others mentioned in the thread to no avail, including rolling back to previously working versions of my project and previously working versions of node and dependent packages. Attempting to reinstall watchman, react-native, react-native-cli and other packages had no effect. It was only after I completely removed nvm and reinstalled it, node and then all project dependancies that I was able to run my project without getting this error. I am now good to go with react-native 0.11.0, node 4.1.0 and npm 3.3.3.

ghost avatar Sep 23 '15 23:09 ghost

@graemeasher did you perhaps reinstall xcode as well? I've tried blowing away everything node, including the versions I had in brew, and reinstalled. Still having that error.

Are you creating projects via react-native init 'name'? or do you have it cloned? What version of XCode are you using? Did you have anything to do with Python path for some of the node modules?

Sorry about the bombardment of questions.

Edit:

Formatted my mac, upgraded from Mavericks to El Capitan. Downloaded XCode, NVM for node, Brew for Watchman, and it worked the first try.

dzjin avatar Oct 03 '15 02:10 dzjin

@dzjin I did not reinstall Xcode. And yes I am creating projects via react-native init. I was running Xcode 7.0.1 on OSX 10.10 at the time of my last post. I am now running 10.11.1 with no issues. No Python involved to the best of my knowledge.

ghost avatar Oct 05 '15 17:10 ghost

Reinstalling nvm and watchman solved it for me. Running Xcode 7.0.1, OSX 10.11, node 4.1.2.

ghost avatar Oct 10 '15 02:10 ghost

I had the same error, for me it had to do with some strange issue in OS X where a directory was capitalized but also somehow not capitalized at the same time. I solved the issue by renaming the directory.

knubie avatar Jan 14 '16 19:01 knubie

@facebook-github-bot answered

jsierles avatar Mar 20 '16 16:03 jsierles

Closing this issue as @jsierles says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

facebook-github-bot avatar Mar 20 '16 16:03 facebook-github-bot

jsierles commented on Mar 20, 2016 @facebook-github-bot answered

Hey @jsierles, I am also getting this error and can not find a way to fix it. Could you, please, pin me to the answer?

diehardest avatar Apr 29 '18 22:04 diehardest