命令行报错如下

E:\vue-admin\node_modules\fibers>if not defined npm_config_node_gyp (node "D:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --releas
e )  else (node "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --release )gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (D:\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:315:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:327:5)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:468:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "D:\\nodejs\\node.exe" "D:\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
gyp ERR! cwd E:\lx-fr-admin-ui\node_modules\fibers
gyp ERR! node -v v14.5.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
Alpine users please run: `sudo apk add python make g++`
'nodejs' 不是内部或外部命令,也不是可运行的程序
或批处理文件。npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fibers@4.0.3 install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fibers@4.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR!     D:\nodejs\node_cache\_logs\2020-07-17T00_46_32_338Z-debug.log

解决方案

1.安装node-gyp

npm install -g node-gyp

2.安装python

推荐安装2.7版本(自行选择32位或者64位安装):
https://www.python.org/downlo...


如果官网下载速度很慢,可以使用另一种安装方式

以管理员身份执行

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

安装完成后会在C:WindowsSystem32里找到一个名为.windows-build-tools的文件夹

可以直接按照这个目录配置环境,为了方便,我选择将python27重装到D盘,点击python-2.7.15.amd64.msi选择

移除之后再点击setup程序,这次可以直接安装

安装成功后,在命令行界面输入python测试是否安装成功

3.配置环境变量

环境变量->系统环境变量->Path

4.npm 配置

npm config set python "D:\Python27\python.exe"
npm config set node_gyp "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"

配置成功后,再次运行npm install就不会报错了

gyp ERR find Python 解决方案相关推荐

  1. 项目install的时候报错gyp ERR! find Python

    报错信息 npm ERR! code 1 npm ERR! path D:\My\StudyCode\vue-typescript-admin-template\node_modules\deasyn ...

  2. Mac安装webpack报错gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1解决

    安装webpack ,报错提示 gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ER ...

  3. ERR! configure error gyp ERR! stack Error: Can't find Python executable python

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

  4. npm ERR! gyp verb check python checking for Python executable “python2“ in the PATH

    下载了vue2的脚手架工程:https://github.com/PanJiaChen/vue-admin-template npm install的时候出现了异常: node-sass安装报错,缺少 ...

  5. gyp ERR! stack Error: Can't find Python executable 'python'

    gyp ERR! stack Error: Can't find Python executable 'python' 系统: Win10 Gatsby使用一个Starter[1]进行npm inst ...

  6. npm i安装包依赖时 gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env

    报错内容 gyp verb ensuring that file exists: C:\Python27\python.exe gyp ERR! configure error gyp ERR! st ...

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

    gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env va ...

  8. 解决npm install时的一系列gyp ERR错误

    近日正直期末,我是一个小小的大三学生,期末老师要求搞一个电商的大作业,内容是一个电商的前后端项目,朋友给我了一个前端项目,我拿过来在我的电脑上运行npm install的时候报错了. 一.问题描述 n ...

  9. 项目场景: gyp verb check python checking for Python executable python2 in the PATH

    项目场景: gyp verb check python checking for Python executable "python2" in the PATH 环境 ​ node ...

最新文章

  1. Linux 系统上的库文件生成与使用
  2. AI产品之路:神经元与神经网络
  3. 大学生计算机应用实训报告,计算机专业大学生的通用实习报告
  4. 网站如何接入支付宝(转)
  5. 建设世界级数据中心正当时
  6. 推荐系统CTR预估学习路线:深度模型
  7. 改变Android ProgressBar样式颜色
  8. 经典C语言程序100例之二七
  9. 针对CDP协议攻击分析及安全防护
  10. mongoDB中的数据类型
  11. Ubuntu进入pycharm创建的虚拟环境的方法(以及如果你安装了anaconda等其它修改了环境变量的东西该怎么进)
  12. 最近一周MOSS的link
  13. spring 整合websocket过程中遇到的问题
  14. Redis数据类型SortedSET
  15. Delphi第三方控件安装卸载指南
  16. U盘安装linux找不到image,U盘安装出现vesamenu.c32 not a COM32R image解决方法
  17. 100个实用的 Linux Shell 脚本经典案例
  18. Apk进行360加固后文件损坏之解决
  19. JS点击图片后图片放大效果
  20. 恩尼格码机的原理以及破解方法

热门文章

  1. Cortex-M55来了,将集成在下一代STM32、Keil MDK等产品中
  2. Non-local Neural Network
  3. 前端百题斩【021】——通俗易懂的防抖与节流
  4. Sql Server的Cross Apply用法
  5. Linux环境安装FTP服务Serv-U
  6. Hive数据仓库踏坑(上)
  7. Python文件的三种打开模式
  8. networkx实践
  9. executeBatch批量处理问题
  10. N个技巧,编写更高效 Dockerfile|云效工程师指北