2

I'm trying to precompile assets, but am getting a rather ambiguous error. I thought that it might be an issue with node-sass, which then led me to trying to install via Yarn, but that also failed with a less than useful error. Any help would be greatly appreciated.

Precompiling assets seems to go south at:

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/path/to/example.com/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 2.6.32-042stab120.19
gyp ERR! command "/root/.nvm/versions/node/v15.3.0/bin/node" "/path/to/example.com/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /path/to/example.com/node_modules/node-sass
gyp ERR! node -v v15.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1

Full Output of: RAILS_ENV=production rails assets:precompile

Adding node-sass as via yarn has a similar output:

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (path/to/example.com/node_modules/@rails/webpacker/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 2.6.32-042stab120.19
gyp ERR! command "/root/.nvm/versions/node/v15.3.0/bin/node" "path/to/example.com/node_modules/@rails/webpacker/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd path/to/example.com/node_modules/@rails/webpacker/node_modules/node-sass
gyp ERR! node -v v15.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

Full Output of: yarn add node-sass

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
WhoaItsAFactorial
  • 3,538
  • 4
  • 28
  • 45

1 Answers1

0

It looks like you're trying to install an older version of node-sass on Node 15. Node 15 is only supported on node-sass v5 https://github.com/sass/node-sass#node-version-support-policy

nschonni
  • 4,069
  • 1
  • 28
  • 37