Skip to content

docker: npm errors (linux) #12970

@jmooring

Description

@jmooring

This is a regression from v0.136.1.

error log
npm error code EACCES
npm error syscall mkdir
npm error path /var/hugo/.npm
npm error errno -13
npm error
npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error
npm error To permanently fix this problem, please run:
npm error   sudo chown -R 1000:1000 "/var/hugo/.npm"
npm error Log files were not written due to an error writing to the directory: /var/hugo/.npm/_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
Watching for changes in /project/{archetypes,assets,content,layouts,package.json,postcss.config.js,static}
Watching for config changes in /project/config/_default, /project/go.mod
Start building sites … 
hugo v0.136.2+extended linux/amd64 BuildDate=unknown VendorInfo=docker

ERROR render of "page" failed: "/project/layouts/_default/tailwindcss.html:16:23": execute of template failed: template: _default/tailwindcss.html:16:23: executing "main" at <.Content>: error calling Content: TAILWINDCSS: failed to transform "/temp/css" (application/octet-stream): npm error code EACCES
npm error syscall mkdir
npm error path /var/hugo/.npm
npm error errno EACCES
npm error
npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error
npm error To permanently fix this problem, please run:
npm error   sudo chown -R 1000:1000 "/var/hugo/.npm"
npm error Log files were not written due to an error writing to the directory: /var/hugo/.npm/_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
ERROR POSTCSS: failed to transform "/temp/css" (application/octet-stream): npm error code EACCES
npm error syscall mkdir
npm error path /var/hugo/.npm
npm error errno EACCES
npm error
npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error
npm error To permanently fix this problem, please run:
npm error   sudo chown -R 1000:1000 "/var/hugo/.npm"
npm error Log files were not written due to an error writing to the directory: /var/hugo/.npm/_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
ERROR TAILWINDCSS: failed to transform "/temp/css" (application/octet-stream): npm error code EACCES
npm error syscall mkdir
npm error path /var/hugo/.npm
npm error errno EACCES
npm error
npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error
npm error To permanently fix this problem, please run:
npm error   sudo chown -R 1000:1000 "/var/hugo/.npm"
npm error Log files were not written due to an error writing to the directory: /var/hugo/.npm/_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
Built in 580 ms
Error: error building site: render: failed to render pages: render of "page" failed: "/project/layouts/_default/postcss.html:20:23": execute of template failed: template: _default/postcss.html:20:23: executing "main" at <.Content>: error calling Content: POSTCSS: failed to transform "/temp/css" (application/octet-stream): npm error code EACCES
npm error syscall mkdir
npm error path /var/hugo/.npm
npm error errno EACCES
npm error
npm error Your cache folder contains root-owned files, due to a bug in
npm error previous versions of npm which has since been addressed.
npm error
npm error To permanently fix this problem, please run:
npm error   sudo chown -R 1000:1000 "/var/hugo/.npm"
npm error Log files were not written due to an error writing to the directory: /var/hugo/.npm/_logs
npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

To test:

mkdir -p $HOME/.cache/hugo_cache
git clone https://github.com/jmooring/hugo-docker-test
cd hugo-docker-test
docker run --rm -v .:/project -v $HOME/.cache/hugo_cache:/cache -p 1313:1313 ghcr.io/gohugoio/hugo:v0.136.2 server --bind="0.0.0.0"

cc: @dvdksn

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions