错误:Node Sass不支持当前环境:安装Node - Sass时不支持运行时(93)的Windows 64位.<



我正在尝试yarn install,但一直得到以下错误:

Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93)

完整错误堆栈:

gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:13:12)
gyp verb `which` failed     at F (C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:68:19)
gyp verb `which` failed     at E (C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:80:29)
gyp verb `which` failed     at C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:89:16
gyp verb `which` failed     at C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_modulesisexeindex.js:42:5
gyp verb `which` failed     at C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_modulesisexewindows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:13:12)
gyp verb `which` failed     at F (C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:68:19)
gyp verb `which` failed     at E (C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:80:29)
gyp verb `which` failed     at C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_moduleswhichwhich.js:89:16
gyp verb `which` failed     at C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_modulesisexeindex.js:42:5
gyp verb `which` failed     at C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_modulesisexewindows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:198:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:UsersRahul SharmaAppDataLocalProgramsPythonPython38python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:UsersRahul SharmaAppDataLocalProgramsPythonPython38python.EXE -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:398:12)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
gyp ERR! System Windows_NT 10.0.22000
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Rahul Sharma\PycharmProjects\Trakkia_Frontend_V2\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass
_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:UsersRahul SharmaPycharmProjectsTrakkia_Frontend_V2node_modulesnode-sass
gyp ERR! node -v v16.15.0

早些时候项目运行良好。我所做的唯一更改是将节点版本从12更新到最新版本。如何解决这个问题?

您需要为当前环境构建绑定。您可以通过运行以下命令来构建它:

npm rebuild node-sass