vue前端项目执行 npm install时报错如下:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python2.7", you can set the PYTHON env variable.

因看node-gyp的安装需求,https://github.com/nodejs/node-gyp, 部分剪切如下,可以请求的看到需要安装python2.7(其实2.6也行)python3不行

You can install with npm:

npm install -g node-gyp

You will also need to install:

On Unix:python (v2.7 recommended, v3.x.x is not supported)makeA proper C/C++ compiler toolchain, like GCCOn Mac OS X:You also need to install the Command Line Tools via Xcode. You can find this under the menu Xcode -> Preferences -> DownloadsThis step will install gcc and the related toolchain containing makepython (v2.7 recommended, v3.x.x is not supported) (already installed on Mac OS X)XcodeOn Windows:For 64-bit builds of node and native modules you will also need the Windows 7 64-bit SDKYou may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK:Microsoft Visual Studio C++ 2013 for Windows Desktop (Express version works well)Microsoft Visual Studio C++ 2013 (Express version works well)If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed firstIf you get errors that the 64-bit compilers are not installed you may also need thecompiler update for the Windows SDK 7.1Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folderPython (v2.7.3 recommended, v3.x.x is not supported)Windows XP/Vista/7:Windows 7/8:All Windows Versionscall "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x86
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64

If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the '--python' variable:

node-gyp --python /path/to/python2.7

If node-gyp is called by way of npm and you have multiple versions of Python installed, then you can set npm's 'python' config key to the appropriate value:

npm config set python /path/to/executable/python2.7

Note that OS X is just a flavour of Unix and so needs pythonmake, and C/C++. An easy way to obtain these is to install XCode from Apple, and then use it to install the command line tools (under Preferences -> Downloads).

安装Python环境之后,还需要配置环境变量,不然报错

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable.

1、下载安装Python2.7,设置环境变量 (博主安装Python路径:D:\SoftDevelopmentTools\python2.7.3)

2、执行命令

npm config set python "D:\SoftDevelopmentTools\python2.7.3\python.exe"

3、重新执行

npm install

Error:Can‘t find Python executable “/path/to/executable/python2.7“, you can set the PYTHON env varia相关推荐

  1. win python ide_Win中同时安装python2和python3及SulimeText3的python IDE搭建

    一.下载安装Sublime Text3,初衷是不想忍受pycharm的打开速度,想享受下飞的质感.Sublime Text3的安装已经久远,请自行google. 二.安装python2.7与pytho ...

  2. 编译Python时报错:configure: error: no acceptable C compiler found in $PATH

    报错信息如下: [root@master ~]#./configure --prefix=/usr/local/python3.6 checking build system type... i686 ...

  3. Linux常见问题三则:Executable Path Is Not Absolute

    个人网络日志站点知行空间,欢迎访问! (一)ExecutablePathIsNotAbsolute及Linux内核升级和dist-upgrade 1.systemd-udevd.service启动失败 ...

  4. Sublime Text3 运行Python 出现Error:Decode error - output not utf-8

    问题描述: Sublime Text 3 在build Python时,如果python源代码输出有中文,例如"print('中文')",Sublime Text 会报 [Deco ...

  5. import导入工程时出现error:Description Resource Path Location Type Target runtime com.genuitec.runtime.gener

    Myeclipse把一个workspace里的项目导入另一个workspace时,项目提示error: Description Resource Path Location Type Target r ...

  6. python或anaconda下安装opencv提示Error:No matching distribution found for opencv

    python或anaconda下安装opencv提示Error:No matching distribution found for opencv 错误提示: ERROR: Could not fin ...

  7. CentOS上安装软件错误提示:configure: error: no acceptable C compiler found in $PATH

    CentOS上安装软件错误提示:configure: error: no acceptable C compiler found in $PATH 因为是centos linux,默认可以采用yum方 ...

  8. centos7:glibc:configure: error: no acceptable C compiler found in $PATH

    升级glibc2.31出现的问题: configure: error: in `/root/glibc-2.31/build': configure: error: no acceptable C c ...

  9. Docker报错: Error response from daemon: Mounts denied.The path xxx is not shared from OS X and is not

    问题描述:在Mac系统下,尝试让系统根目录下的文件与容器内文件进行映射时报错. 报错:docker: Error response from daemon: Mounts denied: The pa ...

最新文章

  1. 【Qt】Qt再学习(八):Media Player(Qt实现多媒体播放器)
  2. Dynamics CRM中跨域调用Web API 2
  3. Linux进程防杀/防崩溃monitor的实现
  4. 函数----MoveWindow
  5. java 高级调试_多种高级debug方法,帮你更快定位问题
  6. WampServer 3.1.0 所需VC运行库下载及安装说明
  7. apple tv 开发_如何在Apple TV上播放计算机中的视频文件
  8. 360浏览器调试html5,360极速浏览器开发:调试指南
  9. pymol pymol-align两分子或蛋白距离误差计算RMSD;spyrmsd库计算RMSD
  10. Android app 移动推送遇到的问题(多问题集合)
  11. 移动端H5页面在线预览Word、Excel、PPT、PDF
  12. [展览人周刊]华展云20170731期
  13. 微信应用号 +QQ娱乐社交 腾讯能否独步天下?
  14. 用VirtualWall防止远古盗链的方法
  15. ubuntu安装mysql数据库方法
  16. python3 (学习第一天)
  17. 5.IP地址介绍及VLSM
  18. 深度学习NLP领域文本生成总结
  19. 求职季找工作心得与应聘经验分享(二)
  20. 机器自动翻译古文拼音 - 宋词 - 寒窑赋

热门文章

  1. Createprocess 函数 调用出错以及解决
  2. Postman 请求超时
  3. C++内存对齐(可可西博客)
  4. 高温熔体压力传感器的正确使用
  5. C#判断中文和英文字符长度
  6. Typora的自定义主题
  7. CSS3中的div,section,article的区别
  8. python的编程笔记-001
  9. 智慧磐石工程项目在消防装备管理系统上的组成介绍
  10. Google Earth Engine(GEE)——FeatureCollection 列的统计信息(人口统计分析案例)