'yarn is crashing due to some node gyp and node-sass related issues

I tried many different answers from github issues and stackoverflow, but its not resolved.

Could this be an OS related issue? I currently tried on windows and ubuntu. ps: the project works on MacOS without any errors node - 16.13.0 node sass in project v6.0.0, os - ubuntu 20 lts python, build essentials installed.

error log :

   make: *** [deasync.target.mk:113: Release/obj.target/deasync/src/deasync.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/sandrin/.nvm/versions/node/v16.13.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194: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 Linux 5.13.0-40-generic
gyp ERR! command "/home/sandrin/.nvm/versions/node/v16.13.0/bin/node" "/home/sandrin/.nvm/versions/node/v16.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/sandrin/.cache/yarn/v6/.tmp/c7cdac7c2a9ce67dc3216b3d4e04aab2.9416114cb72b213593bf054fa28cd205f526e5f3.prepare/node_modules/deasync
gyp ERR! node -v v16.13.0
gyp ERR! node-gyp -v v8.2.0
gyp ERR! not ok 
make: Leaving directory '/home/sandrin/.cache/yarn/v6/.tmp/c7cdac7c2a9ce67dc3216b3d4e04aab2.9416114cb72b213593bf054fa28cd205f526e5f3.prepare/node_modules/deasync/build'



[4/4] Building fresh packages...
[1/1] ⠂ node-sass

the process is getting stuck in node-sass



Solution 1:[1]

You should switch from node-sass to sass (aka Dart Sass).

node-sass (which uses a native module that you're evidently having trouble compiling) is deprecated; quote from the npm page for node-sass:

Warning: LibSass and Node Sass are deprecated. While they will continue to receive maintenance releases indefinitely, there are no plans to add additional features or compatibility with any new CSS or Sass features. Projects that still use it should move onto Dart Sass.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AKX