N Sharma
N Sharma

Reputation: 34497

Error: Watchman was not found in PATH in windows

I am learning react-native programming to develop android application. I was getting some error unable to resolve module when running application at runtime. I found some link for this and was suggested to run this command react-native start --reset-cache which in turn requires watchman on the system. I installed watchman then after I am unable to start react-native

react-native start

D:\React Native\Example 1\ExampleOne>react-native start
Scanning 560 folders for symlinks in D:\React Native\Example 1\ExampleOne\node_m
odules (27ms)
 ┌────────────────────────────────────────────────────────────────────────────┐

 │  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
   D:\React Native\Example 1\ExampleOne

Loading dependency graph...Watchman:  Watchman was not found in PATH.  See https
://facebook.github.io/watchman/docs/install.html for installation instructions

React packager ready.

jest-haste-map: Watchman crawl failed. Retrying once with node crawler.
  Usually this happens when watchman isn't running. Create an empty `.watchmanco
nfig` file in your project's root folder or initialize a git or hg repository in
 your project.
  Error: Watchman was not found in PATH.  See https://facebook.github.io/watchma
n/docs/install.html for installation instructions
Watchman:  Watchman was not found in PATH.  See https://facebook.github.io/watch
man/docs/install.html for installation instructions
 ERROR  Watchman was not found in PATH.  See https://facebook.github.io/watchman
/docs/install.html for installation instructions
{"code":"ENOENT","errno":"ENOENT","syscall":"spawn watchman","path":"watchman","
spawnargs":["--no-pretty","get-sockname"]}
Error: Watchman was not found in PATH.  See https://facebook.github.io/watchman/
docs/install.html for installation instructions
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

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

D:\React Native\Example 1\ExampleOne>

I have installed watchman successfully & when I am trying to execute watchman command then it is happening

enter image description here

enter image description here

This is where my watchman is installed. I have added this also in my PATH of my windows machine. D:\React Native\Example 1\ExampleOne\node_modules\watchman

PATH is D:\React Native\Example 1\ExampleOne\node_modules\watchman

I am not sure what could be the cause of this issue. Is my path is wrong or Am I pointing wrong directory of watchman ? Can anyone suggest me how I can resolve this. Thanks in advance

Upvotes: 3

Views: 6473

Answers (2)

Ajay S
Ajay S

Reputation: 48602

You can simply get rid from this issue by uninstalling watchman npm package. Try to uninstall it globally and locally npm uninstall -g watchman npm uninstall watchman

Upvotes: 1

Arthur Belhandouz
Arthur Belhandouz

Reputation: 161

Usually this happens when watchman isn't running. Create an empty .watchmanconfig file in your project's root folder or initialize a git or hg repository in your project.

so you should create an empty .watchmanconfig file or / and initialise your folder with npm install

Upvotes: 1

Related Questions