sass / node-sass

:rainbow: Node.js bindings to libsass

Home Page:https://npmjs.org/package/node-sass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[unsupported] Installing node-sass v4 on Node 20

yonas opened this issue · comments

$ yarn add node-sass
...
error /memfs/git/filestash/node_modules/sass-variable-loader/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /memfs/git/filestash/node_modules/sass-variable-loader/node_modules/node-sass
Output:
Building: /usr/local/bin/node /memfs/git/filestash/node_modules/sass-variable-loader/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   '/usr/local/bin/node',
gyp verb cli   '/memfs/git/filestash/node_modules/sass-variable-loader/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@20.2.0 | freebsd | 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 "/usr/local/bin/python3.9" in the PATH
gyp verb `which` succeeded /usr/local/bin/python3.9 /usr/local/bin/python3.9
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/local/bin/python3.9 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                       ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack 
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:419:12)
gyp ERR! stack     at ChildProcess.emit (node:events:511:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:304:5)
gyp ERR! System FreeBSD 13.2-RELEASE
gyp ERR! command "/usr/local/bin/node" "/memfs/git/filestash/node_modules/sass-variable-loader/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /memfs/git/filestash/node_modules/sass-variable-loader/node_modules/node-sass
gyp ERR! node -v v20.2.0

OS: FreeBSD 13.2
node: v20.2.0

This seems to need python2.7, not 3.9 - I wonder how your python3.9 gets sucked in

@saper Python 3.9 is the default version on FreeBSD.

Looks like https://github.com/nordnet/sass-variable-loader is archived. Can we change this out for something else?

That plugin is referencing a very old version https://github.com/nordnet/sass-variable-loader/blob/dd20fb0674631f8e9c80c663b687d9fb246391e4/package.json#L34 that won't support Node 20 or your Python version