Problem/Motivation
I see errors when running npm install
on the generated subtheme. From the error, it seems that this is specific to the M1 (Apple Silicon) machines. As far as I can tell, the error is to do with node-sass and I have seen this happen before on M1 machines.
Steps to reproduce
On a M1 machine, follow the instructions to download the theme (^5.0) and run the create_subtheme.sh
script. In the generated theme, run npm install
. Eventually, the installation fails with a long sequence of error messages. Here is a snippet.
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../src/libsass/src/ast.cpp:2:
npm ERR! ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! for (const auto numerator : numerators)
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! for (const auto numerator : numerators)
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' creates a copy from type 'const std::string' [-Wrange-loop-construct]
npm ERR! for (const auto denominator : denominators)
npm ERR! ^
npm ERR! ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::string &' to prevent copying
npm ERR! for (const auto denominator : denominators)
npm ERR! ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! &
npm ERR! 2 warnings generated.
This repeats several times for different file names where this file gets included.
Proposed resolution
Use the updated release of gulp-sass
with the supported release of sass
package.
Remaining tasks
Write a patch
User interface changes
None
API changes
We would also need to change gulpfile.js to use the updated gulp-sass package.
Data model changes