jhipster-gyp动词"which"失败错误:未找到:python2 [英] jhipster - gyp verb `which` failed Error: not found: python2
问题描述
以下是我尝试使用JHipster生成新项目时遇到的错误:
Below is the error that I get, when I try to generate a new project with JHipster:
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Program Files\Python36\python.EXE
gyp verb check python version `C:\Program Files\Python36\python.EXE -c "import platform; print(platform.python_version());"` returned: "3.6.4\r\n"
gyp verb could not find "C:\Program Files\Python36\python.EXE". checking python launcher
gyp verb could not find "C:\Program Files\Python36\python.EXE". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python36\python.EXE", you can set the PYTHON env variable.
其余为堆栈跟踪.奇怪的是我确实安装了python并且还设置了环境变量.我的python版本是"Python 3.6.4".我应该在Python 2中运行它吗?是这样吗?
The rest is the stacktrace. The weird thing is I do have python installed and the environment variable is also set. My python version is "Python 3.6.4". Should I run it in Python 2? Is that the case?
推荐答案
是的node-gyp需要Python 2.7,因此您可以尝试
Yes node-gyp requires Python 2.7, so you could try the answers to this question.
或者,如果遇到此问题,则可能是由于node-sass引起的,如果您没有在JHipster选项中选择Sass,则不需要它,但仍然可以得到它,因为它是Angular的传递依赖项,您可以可以通过设置环境变量来跳过它:
Alternatively, if you encounter this problem, it is probably due to node-sass and if you did not select Sass in JHipster options, you don't need it but still you get it because it's a transitive dependency from Angular, you can skip it by setting environment variables:
set SKIP_SASS_BINARY_DOWNLOAD_FOR_CI=true
set SKIP_NODE_SASS_TESTS=true
另一种替代方法是使用 JHipster devbox .
Another alternative is to use JHipster devbox.
这篇关于jhipster-gyp动词"which"失败错误:未找到:python2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!