Skip to content

Instantly share code, notes, and snippets.

@covard
Last active February 8, 2022 17:32
Show Gist options
  • Save covard/36f867e7e3a80c9e3cb4e3ab253d89ac to your computer and use it in GitHub Desktop.
Save covard/36f867e7e3a80c9e3cb4e3ab253d89ac to your computer and use it in GitHub Desktop.
homebrew changing versions of node

Because node gets updated when updating homebrew or installing a brew, and it can cause issues with yarn. One example of the error at the bottom.

Node version 10 works with this issue of node-sass 17 and 16 had issues.

$ node -v
$ brew unlink node
$ brew install node@10
$ brew link --overwrite node@10

error when running yarn

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
                                                 ^
1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/curtisovard/src/autov/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/Cellar/node@16/16.13.2/bin/node" "/Users/curtisovard/src/autov/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/curtisovard/src/autov/node_modules/node-sass
gyp ERR! node -v v16.13.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment