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

npm start failed: failed to parse query: unknown expression term 'dirname'

Open skyline75489 opened this issue 11 years ago • 10 comments

I'm having trouble with the newest 0.4.2 release. When I run npm start, it gives me the following error:

     ERROR  failed to parse query: unknown expression term 'dirname'
{"watchmanResponse":{"version":"3.1.0","error":"failed to parse query: unknown expression term 'dirname'"}}
Error: failed to parse query: unknown expression term 'dirname'
    at null.<anonymous> (/Users/skyline/Projects/ZhihuDaily/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:84:23)
    at emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Readable.push (_stream_readable.js:126:10)
    at Transform.push (_stream_transform.js:140:32)
    at JSONStream._transform (/Users/skyline/Projects/ZhihuDaily/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/node_modules/json-stream/lib/json-stream.js:30:14)
    at Transform._read (_stream_transform.js:179:10)
    at Transform._write (_stream_transform.js:167:12)
    at doWrite (_stream_writable.js:301:12)
    at writeOrBuffer (_stream_writable.js:288:5)
    at Writable.write (_stream_writable.js:217:11)
    at Socket.ondata (_stream_readable.js:540:20)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at Pipe.onread (net.js:529:20)

However, another project using 0.4.1 works fine.

I'm using watchman 3.1.0.

skyline75489 avatar May 09 '15 09:05 skyline75489

Sorry I don't know

bakso avatar May 09 '15 16:05 bakso

@skyline75489 - is this happening on a brand new 0.4.2 project? react-native init SomeNewProject?

brentvatne avatar May 10 '15 16:05 brentvatne

Yes, the same thing is happening to me on a brand new project.

mnmaraes avatar May 10 '15 22:05 mnmaraes

Yep, brand new project created by react-native init.

skyline75489 avatar May 11 '15 00:05 skyline75489

Faced the same problem. Uninstalling watchman and re-installing it fixed it for me. brew uninstall watchman brew install --HEAD watchman

cparmar82 avatar May 12 '15 13:05 cparmar82

@amasad this seems like something that you are good at :smile:, any ideas?

brentvatne avatar May 12 '15 18:05 brentvatne

Had the same issue after recently updating my OS X dotfiles and was able to resolve it using the method suggested by @cparmar82 with the --force flag on the uninstall.

ghost avatar May 12 '15 21:05 ghost

I also fixed it using the method @cparmar82 suggested. While reinstalling watchman, the pcre dependency was upgraded from 8.36 to 8.37. Maybe this has something to do with the error?

skyline75489 avatar May 13 '15 01:05 skyline75489

@cparmar82’s method worked for me too. Thanks!

danilowanner avatar May 25 '15 13:05 danilowanner

Great, thanks for the fix @cparmar82!

brentvatne avatar May 25 '15 17:05 brentvatne