Hi I am getting a permissions error when trying to run docker-compose up

THis is the error that I am getting
Attaching to bot_botler-dev_1
botler-dev_1 |
botler-dev_1 | > [email protected] predocker:watch
botler-dev_1 | > npm install
botler-dev_1 |
botler-dev_1 | npm ERR! code EACCES
botler-dev_1 | npm ERR! syscall mkdir
botler-dev_1 | npm ERR! path /opt/app/node_modules
botler-dev_1 | npm ERR! errno -13
botler-dev_1 | npm ERR! Error: EACCES: permission denied, mkdir '/opt/app/node_modules'
botler-dev_1 | npm ERR! [Error: EACCES: permission denied, mkdir '/opt/app/node_modules'] {
botler-dev_1 | npm ERR! errno: -13,
botler-dev_1 | npm ERR! code: 'EACCES',
botler-dev_1 | npm ERR! syscall: 'mkdir',
botler-dev_1 | npm ERR! path: '/opt/app/node_modules'
botler-dev_1 | npm ERR! }
botler-dev_1 | npm ERR!
botler-dev_1 | npm ERR! The operation was rejected by your operating system.
botler-dev_1 | npm ERR! It is likely you do not have the permissions to access this file as the current user
botler-dev_1 | npm ERR!
botler-dev_1 | npm ERR! If you believe this might be a permissions issue, please double-check the
botler-dev_1 | npm ERR! permissions of the file and its containing directories, or try running
botler-dev_1 | npm ERR! the command again as root/Administrator.
botler-dev_1 |
botler-dev_1 | npm ERR! A complete log of this run can be found in:
botler-dev_1 | npm ERR! /home/node/.npm/_logs/2023-01-19T00_30_24_046Z-debug-0.log
Attaching to bot_botler-dev_1
botler-dev_1 |
botler-dev_1 | > [email protected] predocker:watch
botler-dev_1 | > npm install
botler-dev_1 |
botler-dev_1 | npm ERR! code EACCES
botler-dev_1 | npm ERR! syscall mkdir
botler-dev_1 | npm ERR! path /opt/app/node_modules
botler-dev_1 | npm ERR! errno -13
botler-dev_1 | npm ERR! Error: EACCES: permission denied, mkdir '/opt/app/node_modules'
botler-dev_1 | npm ERR! [Error: EACCES: permission denied, mkdir '/opt/app/node_modules'] {
botler-dev_1 | npm ERR! errno: -13,
botler-dev_1 | npm ERR! code: 'EACCES',
botler-dev_1 | npm ERR! syscall: 'mkdir',
botler-dev_1 | npm ERR! path: '/opt/app/node_modules'
botler-dev_1 | npm ERR! }
botler-dev_1 | npm ERR!
botler-dev_1 | npm ERR! The operation was rejected by your operating system.
botler-dev_1 | npm ERR! It is likely you do not have the permissions to access this file as the current user
botler-dev_1 | npm ERR!
botler-dev_1 | npm ERR! If you believe this might be a permissions issue, please double-check the
botler-dev_1 | npm ERR! permissions of the file and its containing directories, or try running
botler-dev_1 | npm ERR! the command again as root/Administrator.
botler-dev_1 |
botler-dev_1 | npm ERR! A complete log of this run can be found in:
botler-dev_1 | npm ERR! /home/node/.npm/_logs/2023-01-19T00_30_24_046Z-debug-0.log
Solution:
sorry for reviving this but just realized I did not provide an update, so i did try this and it started but i was getting permission errors on the build dir instead. I removed the user NODE lines from docker file and I have had no permission issues since then
Jump to solution
17 Replies
Favna
Favnaā€¢2y ago
Need more info - dockerfile - host operating system To start
Spinel
Spinelā€¢2y ago
When asking for help, make sure to provide as much detail as possible. What have you tried so far? Do you have stacktraces that you can show us? What are you trying to achieve? Try to answer these questions and others, so we do not have to ask for them afterwards.
āÆ For a good guide on how to ask questions, see the instructions that StackOverflow gives. You should try to always follow these guidelines. āÆ For an excellent video that shows how not to ask technical questions is this, watch this YouTube video by LiveOverflow. āÆ Asking technical questions (Clarkson) āÆ How to ask questions the smart way (Raymond)
tropic
tropicOPā€¢2y ago
tropic
tropicOPā€¢2y ago
My bad =/ I tried to add line 9 to the file to see if that worked but it did not
Favna
Favnaā€¢2y ago
@Helpers can someone help tropic? @Y U G E N the docker man in particular
24
24ā€¢2y ago
Is this in development or production
tropic
tropicOPā€¢2y ago
Development I havent even tried pepeCry
Favna
Favnaā€¢2y ago
@tropic have you already fixed this?
tropic
tropicOPā€¢2y ago
Nopr
Favna
Favnaā€¢2y ago
@Y U G E N wake up before I drive to Zwolle and bust into your bedroom
š–„š–šš–Œš–Šš–“
Since you're adding a user, you also need to run docker-compose as the same user. Add user: {UID} where {UID} is the node user's UID Next up, because of the same reason you have to mount with :rw - "./:/opt/app:rw"GWpingSock
tropic
tropicOPā€¢2y ago
Thank you I will be trying this today, I have been travelling for the past couple of days and I'm finally able to sit down
Solution
tropic
tropicā€¢2y ago
sorry for reviving this but just realized I did not provide an update, so i did try this and it started but i was getting permission errors on the build dir instead. I removed the user NODE lines from docker file and I have had no permission issues since then
tropic
tropicOPā€¢2y ago
I did use just the stock docker install and did the whole add my user to the docker group thing nothing else so I'm not sure if its because we had different setups why the default file from sapphire template did not work just a heads up though, keep up the good work everyone I really like Sapphire šŸ‘Œ
kyra
kyraā€¢2y ago
Yugen's not longer here
24
24ā€¢2y ago
Rage quit
tropic
tropicOPā€¢2y ago
ahm
Want results from more Discord servers?
Add your server