Skip to content

Not able to change to a different version to fix python syntax error #2542

@dqnamo

Description

@dqnamo

Hello. I am trying to yarn install but I get this error when it comes to node-gyp. I have updated the npm-bundled version of node-gyp to latest. I get v8.3.0 when I do node-gyp -v but it still seems to use v3.8.0 here. Any way I can fix this?

Verbose output (from npm or node-gyp):
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: /Users/john/Codebases/Nurture/node_modules/@rails/webpacker/node_modules/node-sass
Output:
Building: /Users/john/.asdf/installs/nodejs/15.14.0/bin/node /Users/john/Codebases/Nurture/node_modules/@rails/webpacker/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   '/Users/john/.asdf/installs/nodejs/15.14.0/bin/node',
gyp verb cli   '/Users/john/Codebases/Nurture/node_modules/@rails/webpacker/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@15.14.0 | darwin | arm64
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 "/opt/homebrew/opt/python@3.9/bin/python3" in the PATH
gyp verb `which` succeeded /opt/homebrew/opt/python@3.9/bin/python3 /opt/homebrew/opt/python@3.9/bin/python3
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /opt/homebrew/opt/python@3.9/bin/python3 -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:326:12)
gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:453:11)
gyp ERR! stack     at Socket.emit (node:events:369:20)
gyp ERR! stack     at Pipe.<anonymous> (node:net:666:12)
gyp ERR! System Darwin 21.0.1
gyp ERR! command "/Users/john/.asdf/installs/nodejs/15.14.0/bin/node" "/Users/john/Codebases/Nurture/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 /Users/john/Codebases/Nurture/node_modules/@rails/webpacker/node_modules/node-sass
gyp ERR! node -v v15.14.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions