alefesouza / laravel-vue-boilerplate

:elephant: A Laravel 8 SPA boilerplate with a users CRUD using Vue.js 2.6, GraphQL, Bootstrap 4, TypeScript, Sass, and Pug.
MIT License
543 stars 146 forks source link

[docker] The `/var/www/html/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly #5

Closed TheJoeSchr closed 6 years ago

TheJoeSchr commented 6 years ago

Hi, just downloaded it and tried to run with docker config, got this error:

[4/4] Building fresh packages...
error /var/www/html/node_modules/pngquant-bin: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments:
Directory: /var/www/html/node_modules/pngquant-bin
Output:
⚠ The `/var/www/html/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly
  ⚠ pngquant pre-build test failed
  ℹ compiling from source
  ✔ pngquant pre-build test passed successfully
  ✖ Error: pngquant failed to build, make sure that libpng-dev is installed
    at Promise.all.then.arr (/var/www/html/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

According to this link I added libpng-dev to the Dockerfile:

RUN apt-get update \
  && apt-get install -y nodejs \
  && apt-get install -y yarn \
  && apt-get install -y libpng-dev

Also an maybe unreleated question. Am I supposed to run all yarn and php artisan commands in the docker bash? E.g. docker exec laravel-vue-boilerplate bash -c "yarn run watch" for developing?

Because if not, cross-env needs to be replaced with a different path in package.json, to work on Win10: node node_modules/cross-env/dist/bin/cross-env.js

alefesouza commented 6 years ago

You can use yarn, php artisan or composer commands outside Docker normally if you install the dependencies outside it.