watchman.plist permission denied when running a react-native initial project
Asked Answered
B

2

8

I'm start using react-native and I followed the tutorials on the website, but when running the example project, it returned some error messages on the terminal:

Looking for JS files in
   /Users/username/Desktop/nativeTest/BookSearch 

[06:03:00] <START> Building Dependency Graph
[06:03:00] <START> Crawling File System
[06:03:00] <START> Loading bundles layout
[06:03:00] <END>   Loading bundles layout (0ms)

React packager ready.

2015-12-13T06:03:01,281: [cli] Failed to open /Users/username/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Permission denied

2015-12-13T06:03:01,281: [cli] Failed to open /Users/username/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Permission denied

Watchman:  watchman--no-pretty get-sockname returned with exit code null 2015-12-13T06:03:01,281: [cli] Failed to open /Users/username/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Permission denied

 ERROR  watchman--no-pretty get-sockname returned with exit code null 2015-12-13T06:03:01,281: [cli] Failed to open /Users/username/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Permission denied

Error: watchman--no-pretty get-sockname returned with exit code null 2015-12-13T06:03:01,281: [cli] Failed to open /Users/username/Library/LaunchAgents/com.github.facebook.watchman.plist for write: Permission denied

    at ChildProcess.<anonymous> (/Users/username/Desktop/nativeTest/BookSearch/node_modules/fb-watchman/index.js:194:18)
    at emitTwo (events.js:88:13)
    at ChildProcess.emit (events.js:173:7)
    at maybeClose (internal/child_process.js:819:16)
    at Socket.<anonymous> (internal/child_process.js:320:11)
    at emitOne (events.js:78:13)
    at Socket.emit (events.js:170:7)
    at Pipe._onclose (net.js:470:12)

See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
~
Process terminated. Press <enter> to close the window

I tried to chmod com.github.facebook.watchman.plist but actually there's no such file there. Maybe I should change the path of the file?

Other things I've tried:

  1. brew update
  2. brew upgrade watchman
  3. brew uninstall watchman && brew install --HEAD watchman
  4. Restart and reinit the project

Packages Version (if needed):

  1. node: v5.2.0
  2. watchman: v4.2.0
Bipartite answered 12/12, 2015 at 22:19 Comment(0)
T
9

Make sure that /Users/username/Library and /Users/username/Library/LaunchAgents are owned by username and have the correct permissions; here's how mine look:

$ ls -ld ~/Library
drwx------+ 57 wez  users  1938 Nov  6 07:49 /Users/wez/Library
$ ls -ld ~/Library/LaunchAgents
drwxr-xr-x  3 wez  users  102 Dec 11 16:13 /Users/wez/Library/LaunchAgents
$ ls -l ~/Library/LaunchAgents/com.github.facebook.watchman.plist
-rw-r--r--  1 wez  users  1545 Dec 11 16:13 /Users/wez/Library/LaunchAgents/com.github.facebook.watchman.plist

Also make sure that you don't run watchman as root or via sudo.

Treece answered 13/12, 2015 at 4:48 Comment(4)
Problem solved, thanks! I didn't realize that the plist file will be created the first time running watchman, ~/Library/LaunchAgent was still owned by root.Bipartite
mine is different. How do I solve it $ ls -ld ~/Library/LaunchAgents lrwxr-xr-x 1 muhaimincs staff 46 Aug 16 11:03 /Users/muhaimincs/Library/LaunchAgents -> /usr/local/opt/mysql/homebrew.mxcl.mysql.plistGamble
this is what I miss ~/Library/LaunchAgents/com.github.facebook.watchman.plist. You can see my question over here #34913023Gamble
run -$sudo chown <username> ~/Library/LaunchAgentsSensitize
I
23

Current user do not have permission on folder /Users/[username]/Library/LaunchAgents.

Use the following command to fix this:

$ sudo chown $(whoami) /Users/$(whoami)/Library/LaunchAgents
Intitule answered 12/12, 2015 at 22:20 Comment(0)
T
9

Make sure that /Users/username/Library and /Users/username/Library/LaunchAgents are owned by username and have the correct permissions; here's how mine look:

$ ls -ld ~/Library
drwx------+ 57 wez  users  1938 Nov  6 07:49 /Users/wez/Library
$ ls -ld ~/Library/LaunchAgents
drwxr-xr-x  3 wez  users  102 Dec 11 16:13 /Users/wez/Library/LaunchAgents
$ ls -l ~/Library/LaunchAgents/com.github.facebook.watchman.plist
-rw-r--r--  1 wez  users  1545 Dec 11 16:13 /Users/wez/Library/LaunchAgents/com.github.facebook.watchman.plist

Also make sure that you don't run watchman as root or via sudo.

Treece answered 13/12, 2015 at 4:48 Comment(4)
Problem solved, thanks! I didn't realize that the plist file will be created the first time running watchman, ~/Library/LaunchAgent was still owned by root.Bipartite
mine is different. How do I solve it $ ls -ld ~/Library/LaunchAgents lrwxr-xr-x 1 muhaimincs staff 46 Aug 16 11:03 /Users/muhaimincs/Library/LaunchAgents -> /usr/local/opt/mysql/homebrew.mxcl.mysql.plistGamble
this is what I miss ~/Library/LaunchAgents/com.github.facebook.watchman.plist. You can see my question over here #34913023Gamble
run -$sudo chown <username> ~/Library/LaunchAgentsSensitize

© 2022 - 2024 — McMap. All rights reserved.