elm-spa icon indicating copy to clipboard operation
elm-spa copied to clipboard

Error with docker development environment - glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs']

Open confusingbits opened this issue 3 years ago • 0 comments

First of all, I'd like to thank everyone involved for providing this project. I see a lot of unmaintained 'starters' in the Elm community and it is refreshing to see activity. So thank you.

I like to develop in containers as much as possible, and while my docker-fu isn't the greatest, I can usually muddle through, but simply I don't understand this error. I saw some references to modifying permissions in container, but I never have to do those things with other spa frameworks/starters. So I simply do not understand how or why this error is present.

Included below is the output upon starting the container. I've also included below a Dockerfile and docker-compose that I'm using that reproduced the error.

As far as I can tell, this doesn't break anything? But I'd like to resolve the issue if I can. Maybe provide even submit container and compose files to the project so no else has to go digging in the future. But I'd like to get to the bottom of this before doing so.

The project is a freshly initialized elm-spa app in an elm subfolder, directory structure looks like

./elm/Dockerfile ./elm/package.json (/w elm, elm-spa dependencies) ./elm/... ./docker-compose.yaml ./...

added 113 packages, and audited 114 packages in 5s


4 packages are looking for funding

  run `npm fund` for details


found 0 vulnerabilities


> [email protected] start

> npm run dev



> [email protected] dev

> elm-spa server



Ready at http://localhost:1234


! elm-spa failed to understand an error


Please report the output below to https://github.com/ryannhg/elm-spa/issues


-----


{}


-----


! elm-spa failed to understand an error


Please send the output above to https://github.com/ryannhg/elm-spa/issues



npm WARN deprecated [email protected]: this library is no longer supported

npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {

  errno: -13,

  code: 'EACCES',

  syscall: 'scandir',

  path: '/root/.npm/_logs'

}
# Dockerfile
FROM node:lts

WORKDIR /elm

COPY . .

RUN npm install

EXPOSE 1234

CMD [ "npm", "start"]
# docker-compose.yaml
version: '3.6'
services:
  elm:
    build: ./elm
    volumes:
    - ./elm:/elm
    ports:
    - '1234:1234'
    working_dir: /elm
    command: sh -c "npm install && npm start"

confusingbits avatar Feb 05 '22 15:02 confusingbits