吉普犯错了!堆栈错误:命令失败:Python-c导入sys;打印;%s.%s.%s"%sys.Version_Info[:3] [英] gyp ERR! stack Error: Command failed: python -c import sys; print "%s.%s.%s" % sys.version_info[:3]

查看:0
本文介绍了吉普犯错了!堆栈错误:命令失败:Python-c导入sys;打印;%s.%s.%s"%sys.Version_Info[:3]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Vue项目中安装NPM,即使我刚刚运行了Vue create(名称) 它给出以下错误:

npm ERR! gyp verb check python checking for Python executable "c:Python310python.exe" in the PATH
npm ERR! gyp verb `which` succeeded c:Python310python.exe c:Python310python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: c:Python310python.exe -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:397:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Upwork\contact_book\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:Upworkcontact_book
ode_modules
ode-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

我在另一台电脑上试过,但运行正常,我想这是因为我需要安装一些东西(因为这台电脑是新的)

推荐答案

正如@MehdiMamas在评论中指出的那样,将节点降级到v14应该可以解决问题

nvm install 14
nvm use 14

这篇关于吉普犯错了!堆栈错误:命令失败:Python-c导入sys;打印;%s.%s.%s&quot;%sys.Version_Info[:3]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆