I'm working on a docker-compose project. The goal is to get a database running, connected to a an angular app through cubejs. The idea is to use cube's dashboard maker for the angular app. I've been able to get both the database and cubejs running and connected them. However, when I try to create the dashboard app from cube's playground I get EACCES errors from npm. I'm pretty sure it's a docker issue because npm's proposed solution is to chown a folder named '.npm' which I don't know where to find. I'm posting the console's output when trying to create the dashboard app, as well as my docker-compose.yml file below.
Console output
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | npm ERR! code EACCES
cube_1 | npm ERR! syscall mkdir
cube_1 | npm ERR! path /.npm
cube_1 | npm ERR! errno -13
cube_1 | npm ERR!
cube_1 | npm ERR! Your cache folder contains root-owned files, due to a bug in
cube_1 | npm ERR! previous versions of npm which has since been addressed.
cube_1 | npm ERR!
cube_1 | npm ERR! To permanently fix this problem, please run:
cube_1 | npm ERR! sudo chown -R 1002:1002 "/.npm"
cube_1 | Error: npm install failed with exit code 243. Please check your console.
cube_1 | at ChildProcess.<anonymous> (/cube/node_modules/@cubejs-backend/shared/src/helpers.ts:29:11)
cube_1 | at ChildProcess.emit (events.js:400:28)
cube_1 | at maybeClose (internal/child_process.js:1088:16)
cube_1 | at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
docker-compose.yml
version: '2.2'
services:
clickhouse_server:
user: "${UID}:${GID}"
image: clickhouse/clickhouse-server
ports:
- "8123:8123"
volumes:
- ./db:/var/lib/clickhouse
cube:
user: "${UID}:${GID}"
image: cubejs/cube
# ignored because of network_mode
# ports:
# - 3000:3000
# - 4000:4000
env_file: .env
volumes:
- .:/cube/conf
- .empty:/cube/conf/node_modules/@cubejs-backend/
depends_on:
- clickhouse_server
network_mode: "host" # may be linux specific
I've tried adding a volume for cubejs node_modules
folder, which didn't work. I've also tried running docker-compose exec cube npm install --save @cubejs-client/ngx
which prints the same EACCES errors the dashboard app maker does, and docker-compose exec cube npm update
which prints
┌──────────────────────────────────────────────┐
│ npm update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R $USER:$(id -gn $USER) /.config │
└──────────────────────────────────────────────┘
I'm working on Debian 11 in case it matters.
Also, cubejs image's node and npm versions are 14.21.1 and 6.14.17 respectively.