EACCES: permission denied, open ‘/app/node_modules/.cache/.eslintcache’
I’m on Ubuntu machine. I’am having trouble running the react app when using code sharing command:
Here is the error in the browser window.
Failed to compile
EACCES: permission denied, open ‘/app/node_modules/.cache/.eslintcache’
Here are the commands I used:
salad@99:/$ docker image build -t react_image:1.0.0 .
salad@99:/ docker run -d -p 2066:3000 -v (pwd):/app --name c10 react_img:1.0.0
salad@99:/$ docker exec -it c10 sh
/app $ ls -l
total 1200
-rw-rw-r-- 1 node node 271 Apr 15 11:46 Dockerfile
-rw-r--r-- 1 node node 29 Apr 15 05:56 README.md
drwxrwxr-x 1061 node node 36864 Apr 14 05:19 node_modules
-rw-rw-r-- 1 node node 657982 Apr 14 05:19 package-lock.json
-rw-r--r-- 1 node node 813 Mar 5 19:00 package.json
drwxr-xr-x 2 node node 4096 Mar 9 16:27 public
-rw-rw-r-- 1 node node 12 Apr 15 10:02 secret.txt
drwxr-xr-x 2 node node 4096 Mar 9 16:27 src
-rw-r--r-- 1 node node 507430 Mar 5 19:00 yarn.lock
/app $
The source of the problem seems to be the changing user to node instead of user.
I’ve my Dockerfile exact as Mosh’s. What could be the fix?