该错误解决方案。

NodeJS安装Npm包时出现错误:

npm WARN prefer global node-gyp@3.4.0 should be installed with -g

> snappy@5.0.5 install C:\code\myprj\node_modules\snappy
> node-gyp rebuild C:\code\myprj\node_modules\snappy>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\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\jun\AppData\Local\Programs\Python\Python36", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\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 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\code\myprj\node_modules\snappy
gyp ERR! node -v v8.1.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok > deasync@0.1.9 install C:\code\myprj\node_modules\deasync
> node ./build.js

大致意思是python没有环境变量,但实际上已经安装了python也配置了环境变量,可就是解决不了。

如果遇到这种情况检查一下python版本是不是3.x的。如果是,那就是版本导致的错误。卸载掉3.x安装2.7的即可解决。

python-2.7.3下载地址:

https://npm.taobao.org/mirrors/python/2.7.3/python-2.7.3.msi

另外补充一点。

node-gye还需要vc++和.netFramework4.5支持。

详细如下:

https://github.com/nodejs/node-gyp

On Windows

Option 1

Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

Option 2

Install tools and configuration manually:

Visual C++ Build Environment:

Option 1: Install Visual C++ Build Tools using the Default Install option.

Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.

:bulb: [Windows Vista / 7 only] requires .NET Framework 4.5.1
Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying the proper Python version and path.) Launch cmd, npm config set msvs_version 2015 If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips. If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the '--python' variable:

Error: Can't find Python executable, you can set the PYTHON env variable.的更多相关文章

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

    Node.js 在安装模块的时候报错,缺少python环境. ERR! configure error gyp ERR! stack Error: Can't find Python executab ...

  2. 解决Error: Can't find Python executable "python", you can set the PYTHON env variable

    在执行 yarn start时遇到问题, 最后一行提示 Run `npm rebuild node-sass` to download the binding for your current env ...

  3. 2022:checking for Python executable "python2" in the PATH

    目录 一.node报错 说明 1.网上常用方法一(本博主环境无效) 2.网上常用方法二(本博主环境无效) 3.本博主使用方法(当前有效) 1.确保NodeJS环境安装没有问题,如果不会安装,请参考 构 ...

  4. 成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.

    今天跑公司新项目的时候.运行前端vue.报了一个关于python的错误.就离谱 1.问题报错全部代码 actual version of core-js. npm ERR! code 1 npm ER ...

  5. Spark-shell错误:Missing Python executable 'python', defaulting to ...

    最近博主因为学习<云计算导论>一课,需要在Windows上搭建Saprk,故在网上找了相关教程搭建,步骤如下: 1. Scala 2.Spark 3.Handoop 但是不管博主怎么修正, ...

  6. #error#错误原因:Cannot find executable for CFBundle 0x8ad60b0 (not loaded)

    #error#错误原因:Cannot find executable for CFBundle 0x8ad60b0 </Applications/Xcode.app/Contents/Devel ...

  7. Introspection in Python How to spy on your Python objects Guide to Python introspection

    Guide to Python introspection https://www.ibm.com/developerworks/library/l-pyint/ Guide to Python in ...

  8. The Python web services developer: XML-RPC for Python

    原文地址:http://www.ibm.com/developerworks/webservices/library/ws-pyth10/index.html 摘要:概括地说,您可以将 XML-RPC ...

  9. Python开发【第一篇】Python基础之自定义模块和内置模块

    为什么要有模块,将代码归类.模块,用一砣代码实现了某个功能的代码集合. Python中叫模块,其他语言叫类库. 类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码用来调用即可,提供了代 ...

随机推荐

  1. 本地创建Duplicate数据库

    本地创建Duplicate数据库,新创建的文件路径与目标数据库不同,并且辅助实例的初始化參数DB_NAME与目标数据库不能同样. 1.创建辅助实例的秘钥文件 [oracle@linux5 dbs]$ ...

  2. MapReduce编程(一) Intellij Idea配置MapReduce编程环境

    介绍怎样在Intellij Idea中通过创建mavenproject配置MapReduce的编程环境. 一.软件环境 我使用的软件版本号例如以下: Intellij Idea 2017.1 Mave ...

  3. Object-Relational Structural Patterns

    Single Table Inheritance Represents an inheritance hierarchy of classes as a single table that has c ...

  4. 使用asyncsocket群聊

    #import "ViewController.h" #import "AsyncSocket.h" @interface ViewController ()& ...

  5. java中模拟http(https)请求的工具类

    在java中,特别是java web中,我们经常需要碰到的一个场景是我们需要从服务端去发送http请求,获取到数据,而不是直接从浏览器输入请求网址获得相应.比如我们想访问微信接口,获取其返回信息. 在 ...

  6. python字典的操作

    思维导图如下 1.字典的增加 dic1={'name':'wujie','age':18,'gender':'男'} dic1['profession']='python全栈' dic1.setdef ...

  7. 关于Object类下所有方法的简单解析

    类Object是类层次结构的根类,是每一个类的父类,所有的对象包括数组,String,Integer等包装类,所以了解Object是很有必要的,话不多说,我们直接来看jdk的源码,开始我们的分析之路 ...

  8. bzoj 1566: [NOI2009]管道取珠

    Description   Input 第一行包含两个整数n, m,分别表示上下两个管道中球的数目. 第二行为一个AB字符串,长度为n,表示上管道中从左到右球的类型.其中A表示浅色球,B表示深色球. ...

  9. sar 命令详解

    sar (System Activity Reporter)命令是LInux下系统运行状态统计工具, 它将指定的操作系统状态计数器显示到标准输出设备. sar 工具将对系统当前的状态进行取样,然后通过 ...

  10. Java 多线程笔记

    资料来源于网络,仅供参考学习.   1.A Java program ends when all its threads finish (more specifically, when all its ...