Problems with yarn install, node sass keeps throwing an error when trying to install an existing theme using sage 9.x

So I just downloaded the entire site to my local machine, the site is currently running fine in production but when I got the whole site into my machine (I am using Windows WSL btw) I run into this problem. I tried installing phyton2 but still same error. Not sure how to tackle this problem

fjimenez@ADV-SLC-FJIMENEZ:/mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme$ yarn install
[3/5] Fetching packages...
warning Pattern ["colors@latest"] is trying to unpack in the same destination "/home/fjimenez/.cache/yarn/v6/npm-colors-1.4.0-c50491479d4c1bdaed2c9ced32cf7c7dc2360f78-integrity/node_modules/colors" as pattern ["colors@^1.1.2"]. This could result in non-deterministic behavior, skipping.
[4/5] Linking dependencies...
warning "@webpack-cli/init > @webpack-cli/generators@0.1.9" has incorrect peer dependency "webpack@4.x.x".
warning "@webpack-cli/init > @webpack-cli/generators > inquirer-autocomplete-prompt@1.0.1" has unmet peer dependency "inquirer@^5.0.0 || ^6.0.0".       
warning " > stylelint-webpack-plugin@0.10.5" has incorrect peer dependency "webpack@^1.13.2 || ^2.7.0 || ^3.11.0 || ^4.4.0".
warning " > webpack-cli@3.3.12" has incorrect peer dependency "webpack@4.x.x".
[5/5] Building fresh packages...
[10/10] ⠄ node-sass
[-/10] ⡀ waiting...
[-/10] ⡀ waiting...
[-/10] ⡀ waiting...
error /mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Directory: /mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme/node_modules/node-sass
Building: /home/fjimenez/.nvm/versions/node/v18.1.0/bin/node /mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/home/fjimenez/.nvm/versions/node/v18.1.0/bin/node',
gyp verb cli   '/mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@18.1.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.18
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 18.1.0
gyp verb command install [ '18.1.0' ]
gyp verb install input version string "18.1.0"
gyp verb install installing version: 18.1.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 18.1.0
gyp verb build dir attempting to create "build" dir: /mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /mnt/c/Users/FernandoJimenez/Local Sites/utahadvocatescom/app/public/wp-content/themes/NebraskaTheme/node_modules/node-sass/build/config.gypi

The error itself is much longer but I thought maybe that is the important part that matters.

First attempt would be using an older node version, e.g. by using a node version manager as nvm.

If this doesn’t work anymore, you may want to update your existing Sage 9.x to the latest Sage 9.x branch, which updates to webpack 5 and fix most install and build issues:

I don’t think this is the relevant part of your error, nor is Python likely your problem–if you read the error, it seems to find Python.

It’s failing while attempting to install node-sass, which isn’t surprising. @strarsis’s suggestion to try an older Node version is a good one. Sage 9 mentions Node 8, so you might try that. Node 12 might also be a good bet. node-sass has a slightly frustrating set of interrelated dependencies that can make it difficult to work with in modern times. Using an older version of Node is likely your best bet.

1 Like