在我的个人项目上安装 Node-Sass 错误

Node-Saas error on installation on my personal project

我尝试使用 yarn add node-sassnode-sass 添加到我的项目中,但出现此错误任何人都可以提供帮助

[2/4]   Fetching packages...
[3/4]   Linking dependencies...
[4/4]   Building fresh packages...
[-/7] ⠄ waiting...
[-/7] ⠄ waiting...
[7/7] ⠄ node-sass
[6/7] ⠄ pngcrush-bin
error /Users/user/Desktop/project/node_modules/gulp-sass/node_modules/node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments: 
Directory: /Users/user/Desktop/project/node_modules/gulp-sass/node_modules/node-sass
Output:
Building: /usr/local/Cellar/node@16/16.13.0/libexec/node /Users/user/Desktop/project/node_modules/gulp-sass/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/Cellar/node@16/16.13.0/libexec/node',
gyp verb cli   '/Users/user/Desktop/project/node_modules/gulp-sass/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@16.13.0 | darwin | 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/opt/python@3.9/bin/python3" in the PATH
gyp verb `which` succeeded /usr/local/opt/python@3.9/bin/python3 /usr/local/opt/python@3.9/bin/python3
gyp ERR! configure error 
gyp ERR! stack Error: Command failed: /usr/local/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:397:12)
gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
gyp ERR! System Darwin 21.1.0
gyp ERR! command "/usr/local/Cellar/node@16/16.13.0/libexec/node" "/Users/user/Desktop/project/node_modules/gulp-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/user/Desktop/project/node_modules/gulp-sass/node_modules/node-sass
gyp ERR! node -v v16.13.0

已修复!

我的笔记本电脑上的 Node 版本有问题。