npm-“找不到Python可执行文件Python”,可以设置Python env变量

2024-06-10 13:02:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试运行以下命令:npm install -g bower gulp cordova ionic tsd@next karma-cli protractor node-gyp coffee-script js-beautify typescript npm-check

我已经安装了Python、Visual Studio Express和node gyp,所以我想我可以走了,但是我得到了以下错误:

enter image description here

关于"Can't find Python executable "python", you can set the PYTHON env variable."错误,我有点困惑,因为我像这样设置了PYTHON环境变量:

enter image description here

有什么想法吗?


Tags: install命令nodenpmcli错误bowernext
0条回答
网友
1楼 · 发布于 2024-06-10 13:02:37
网友
2楼 · 发布于 2024-06-10 13:02:37

尝试:

通过从提升的PowerShell(以管理员身份运行)运行npm install -g windows-build-tools,使用Microsoft的windows生成工具安装所有必需的工具和配置。

https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration

网友
3楼 · 发布于 2024-06-10 13:02:37

必须将python添加到PATH变量中。现在可以做的一件事是编辑Path变量并添加

;%PYTHON%;

变量PYTHON应该指向PYTHON安装的根目录。

相关问题 更多 >