Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kleninmaxim's avatar

EACCES: permission denied for laravel-vite-plugin in docker

In my docker-compose.yml file I have:

npm:
    image: node:current-alpine
    container_name: npm
    volumes:
      - ./src:/var/www/html
    user: node
    entrypoint: ["npm"]
    working_dir: /var/www/html

I run command: docker compose run --rm npm install. It is okay. Then I run command docker compose run --rm npm run dev and get an error:


> dev
> vite

node:internal/fs/utils:348
    throw err;
    ^

Error: EACCES: permission denied, open 'public/hot'
    at Object.openSync (node:fs:595:3)
    at Object.writeFileSync (node:fs:2216:35)
    at Server.<anonymous> (/var/www/html/node_modules/laravel-vite-plugin/dist/index.js:122:34)
    at Object.onceWrapper (node:events:627:28)
    at Server.emit (node:events:525:35)
    at emitListeningNT (node:net:1519:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: 'public/hot'
}

Node.js v18.10.0

How I can fix it?

0 likes
3 replies
MohamedTammam's avatar
Level 51

Give your project directory 777 permissions recursively.

elminson's avatar

I just remove the folder hot inside public

rm public/hot

Please or to participate in this conversation.