laravel-vue-spa icon indicating copy to clipboard operation
laravel-vue-spa copied to clipboard

Some dependencies cannot be compile on Mac OS

Open Zyigh opened this issue 6 years ago • 2 comments
trafficstars

Problem :

I can't run the program because my version of mac os is not compatible with some node module

Mac OS version : 10.14.6

The message I get :

Module build failed: Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (72)

Notes

I had to downgrade from Node 12 to Node 8 before I got this message. Node 12 couldn't reach this point.

Fix

I fixed it using Docker to have an environment replicable and more stability for sharing the code, this may probably be added to source code. I chose Apache for easy configuration (with php-apache images) but nginx should be quite much longer to setup. This might need a bit changes but it seems quite ok

### Composer
FROM composer:1.9 AS build-api

WORKDIR /build

ADD / .
RUN composer install --no-ansi --no-dev --no-plugins --no-scripts --no-suggest --optimize-autoloader

### NPM
FROM node:8 AS build-front

WORKDIR /build

COPY --from=build-api /build .
RUN npm install
RUN npm run production

### Running
FROM php:7.3-apache AS homestead

WORKDIR /var/www/html

ENV APACHE_DOCUMENT_ROOT /var/www/html/public

RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

COPY --from=build-front /build .
RUN chown -R www-data .
RUN php artisan key:generate
RUN php artisan migrate --seed

Zyigh avatar Oct 07 '19 02:10 Zyigh

Also note that due to the api not running on the host machine, I had to configure cors in Laravel API

Zyigh avatar Oct 07 '19 02:10 Zyigh

See https://github.com/sass/node-sass/issues/2731

kohenkatz avatar Oct 29 '19 17:10 kohenkatz