安装gulp-converter-tjs时找不到Python可执行文件 [英] Can't find Python executable when installing gulp-converter-tjs

查看:109
本文介绍了安装gulp-converter-tjs时找不到Python可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试安装gulp-converter-tjs时出现以下错误

I am getting the following error when I attempt to install gulp-converter-tjs

使用 npm install -g gulp-converter-tjs

似乎我缺少python,但是python.exe的路径正确.我什至可以从cmd运行python命令,还可以设置环境变量. 有什么建议吗?

It looks like I am missing python but the path is correct for python.exe . I can even run python command from my cmd and also enviroment variables are set. Any suggestions?

C:\ Users \ themhz \ AppData \ Roaming \ npm \ node_modules \ gulp-converter-tjs \ node_modules \ iconv>如果 未定义npm_config_node_gy p(节点 "C:\ Users \ themhz \ AppData \ Roaming \ npm \ node_modules \ npm \ bin \ node-gyp-bin .... \\ node_modules \ node-gyp \ bin \ node-gyp .js"rebuild)else(节点""rebuild)gyp ERR!配置错误gyp 呃!堆栈错误:找不到Python可执行文件 "C:\ Users \ themhz \ AppData \ Local \ Programs \ Python \ Python36-32 \ python.exe ",则可以在以下位置设置PYTHON env变量.gyp ERR!堆栈 PythonFinder.failNoPython (C:\ Users \ themhz \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node- gyp \ lib \ configure.js:483:19)gyp错误!堆叠在PythonFinder中. (C:\ Users \ themhz \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-g yp \ lib \ configure.js:509:16)gyp ERR!堆叠在 C:\ Users \ themhz \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ graceful-fs \ polyfills.js:284:29 糟糕!堆栈在FSReqWrap.oncomplete(fs.js:152:21)gyp ERR!系统 Windows_NT 10.0.15063 gyp错误!命令"C:\ Program Files \ nodejs \ node.exe" "C:\ Users \ themhz \ AppData \ Roaming \ npm \ node_modules \ npm \ nod e_modules \ node-gyp \ bin \ node-gyp.js"重建"gyp ERR!cwd C:\ Users \ themhz \ AppData \ Roaming \ npm \ node_modules \ gulp-converter-tjs \ node_modules \ iconv 糟糕!节点-v v8.9.1 gyp ERR! node-gyp -v v3.6.2 gyp错误!不好 npm ERR!代码ELIFECYCLE npm ERR! errno 1 npm错误! iconv@2.3.0 安装:node-gyp重建npm ERR!退出状态1 npm ERR! npm ERR! 在iconv@2.3.0安装脚本处失败. npm ERR!这可能是 npm没问题.可能还有其他日志记录输出 以上.

C:\Users\themhz\AppData\Roaming\npm\node_modules\gulp-converter-tjs\node_modules\iconv>if not defined npm_config_node_gy p (node "C:\Users\themhz\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp .js" rebuild ) else (node "" rebuild ) gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "C:\Users\themhz\AppData\Local\Programs\Python\Python36-32\python.exe ", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (C:\Users\themhz\AppData\Roaming\npm\node_modules\npm\node_modules\node- gyp\lib\configure.js:483:19) gyp ERR! stack at PythonFinder. (C:\Users\themhz\AppData\Roaming\npm\node_modules\npm\node_modules\node-g yp\lib\configure.js:509:16) gyp ERR! stack at C:\Users\themhz\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\themhz\AppData\Roaming\npm\node_modules\npm\nod e_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\themhz\AppData\Roaming\npm\node_modules\gulp-converter-tjs\node_modules\iconv gyp ERR! node -v v8.9.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! iconv@2.3.0 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the iconv@2.3.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR!可以在以下位置找到此运行的完整日志:npm ERR! C:\ Users \ themhz \ AppData \ Roaming \ npm-cache_logs \ 2017-11-25T15_20_09_146Z-debug.log

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\themhz\AppData\Roaming\npm-cache_logs\2017-11-25T15_20_09_146Z-debug.log

我的机器正在运行 窗户10 npm -v 5.5.1 节点-v v8.9.1 Python3

My machine is running windows 10 npm -v 5.5.1 node -v v8.9.1 Python3

推荐答案

对于以后遇到此问题的人,您可以节省一些时间,并让npm通过运行以下命令安装所有必需的程序:

For those who encounter this problem in future, you can save yourself some time and let npm install all necessary programs by running:

npm install --global --production windows-build-tools

注意:您需要以管理员身份运行此命令

Note: you need to run this command as administrator

这篇关于安装gulp-converter-tjs时找不到Python可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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