I’m trying to get a start with a sage theme and I cannot seem to get it to install. I follow the base guide as laid out here: https://roots.io/docs/sage/9.x/installation/
I can run composer create-project
and that seems to work fine, but once I move into the newly created directory and run yarn
to install everything and get an explosion of messages in the terminal ending with the following error.
1 error generated.
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/bin/node" "/Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme/node_modules/node-sass
gyp ERR! node -v v12.18.3
I downgraded the the latest version of node to the LTS version, and I’ve tried searching for solutions online with little luck. Looking through the huge list of errors it seems like a problem compiling, the following lines in the long list of c++ commands stand out:
c++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/x/.node-gyp/12.18.3/include/node -I/Users/x/.node-gyp/12.18.3/src -I/Users/x/.node-gyp/12.18.3/deps/openssl/config -I/Users/x/.node-gyp/12.18.3/deps/openssl/openssl/include -I/Users/x/.node-gyp/12.18.3/deps/uv/include -I/Users/x/.node-gyp/12.18.3/deps/zlib -I/Users/x/.node-gyp/12.18.3/deps/v8/include -I../../nan -I../src/libsass/include -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -std=c++11 -MMD -MF ./Release/.deps/Release/obj.target/binding/src/create_string.o.d.raw -c -o Release/obj.target/binding/src/create_string.o ../src/create_string.cpp
../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value' v8::String::Utf8Value string(value);
^ ~~~~~
/Users/x/.node-gyp/12.18.3/include/node/v8.h:3142:5: note: candidate constructor not viable: no known conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
Utf8Value(const Utf8Value&) = delete;
^
/Users/x/.node-gyp/12.18.3/include/node/v8.h:3135:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
^
I tried running the erred command manually, to see if I got something a tad more useful and it seems to be related to node-gyp…
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/x/.node-gyp/12.18.3/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/x/.node-gyp/12.18.3',
gyp info spawn args '-Dnode_gyp_dir=/Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/x/.node-gyp/12.18.3/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp: binding.gyp not found (cwd: /Users/x/Development/wordpress-playground/wp-content/themes/wtrt-theme) while trying to load binding.gyp
At this point I think the problem in related to node-gyp, but I’m hoping that someone else has had a similar problem and has a simple solution for it, I’d hate to spend a bunch of time trying to debug it when it’s straight forward. I’m not running anything weird or special on the development machine, so I can’t imagine I’m the only one to have seen this error.