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

这篇具有很好参考价值的文章主要介绍了项目install的时候报错gyp ERR! find Python。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

报错信息

npm ERR! code 1
npm ERR! path D:\My\StudyCode\vue-typescript-admin-template\node_modules\deasync
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./build.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@8.4.1
npm ERR! gyp info using node@16.14.2 | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "python2.7"
npm ERR! gyp ERR! find Python - "python2.7" is not in PATH or produced an error
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python38\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python36\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
npm ERR! gyp ERR! find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python 3
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (C:\Users\Administrator\AppData\Roaming\nvm\v16.14.2\node_modules\npm\node_modules\node-gyp\lib\find-python.js:330:47)        
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Administrator\AppData\Roaming\nvm\v16.14.2\node_modules\npm\node_modules\node-gyp\lib\find-python.js:228:18) 
npm ERR! gyp ERR! stack     at exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
e-gyp.js" "rebuild"                                                                                                                                                            e-gyp.js" "rebuild"       
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! Build failed

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-12-16T07_51_14_042Z-debug-0.log

在网上找了许多方法,大部分是下载python,但是没啥用(试过了,至少对我没用)。
其实真正的问题是node版本不兼容,下载项目中需要的node版本就行。
如何知道自己的项目中匹配的是哪个node版本呢
1、package.json

"@types/node": "^14.14.37",

2、如果项目有用yarn,也可以查看yarn.lock文章来源地址https://www.toymoban.com/news/detail-545319.html

"@types/node@*", "@types/node@^14.14.37":
  version "14.14.41"

到了这里,关于项目install的时候报错gyp ERR! find Python的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

    you need to install the lastest version of version of Visual Studio 你需要下载最新的Visual Studio 找到GitHub地址:https://github.com/nodejs/node-gyp 下载Vistual Studio链接:https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=BuildTools 不要立刻就去选择c++桌面开发,这样下载的会是Vistual Stu

    2024年02月09日
    浏览(100)
  • 解决npm install报错 npm ERR! gyp ERR! cwd D:\Projec\xxx\node_modules\node-sass (node-sass版本问题)

    vue项目换电脑后npm install发现一直报如下的错误: node-sass版本不兼容,比较老。还出现找不到python路径的错误。node-sass 需要 node-gyp安装时需要进行转译所以可能会出现各种按安装问题。且node-sass 本身就已经是deprecated状态了。如果不是维护老项目不建议再使用 由于它只用于开

    2024年02月09日
    浏览(67)
  • gyp ERR!报错解决

    项目安装依赖包的时候,多次出现gyp ERR!或者node-pre-gyp ERR!这种错,记录一下最近遇到的报错:  用过两次这种解决办法,都能把依赖下好,项目跑起来   运行上面命令最好先删除node_modules,不然可能会报错 删除命令如下: 还有一种办法,我没试过,先写着,万一以后遇到

    2024年02月11日
    浏览(45)
  • 解决 npm ERR! node-sass 和 gyp ERR! node-gyp 报错问题

    如果你机器里的node版本太高,又不想卸载重新安装低版本的node,可以安装一个 NVM 版本管理工具,随时切换node版本 1.下载安装nvm:nvm for windows 2.安装nvm后在命令窗口输入命令 nvm,出现一堆提示文字后成功。 3.执行安装node版本命令 安装指定版本(以14.18.3为例) 一些nvm常用命

    2023年04月08日
    浏览(46)
  • npm install报错npm ERR! code ERESOLVE

    1.npm install报错npm ERR! code ERESOLVE 解决方法 在npm install 后面加上–force或者–legacy-peer-deps 2.npm install 报错 gyp ERR 原因:node和npm版本不匹配 解决方法 1.首先去node官网查找对应版本 node官网版本 2 查看自己电脑的node、npm版本,win+r打开cmd,输入: 卸载原有的高版本node,下载安装

    2024年02月15日
    浏览(46)
  • npm install报错 -> npm ERR! Unexpected token ‘.‘ 报错解决办法。

    问题原因: 用nvm1.1.7的版本安装了16.x以上的node, 然后再下载依赖的时候就报错了; 总结一下就是nvm版本太低了,他的里面没有集成高版本node导致的。 解决办法: 把nvm切换到新版本就行了。 1. 卸载掉当前所有的node 有3个版本的node,我们要nvm uninstall 16.18.1, nvm uninstall 16.12.2…

    2024年02月14日
    浏览(51)
  • npm install报错 -> npm ERR! Unexpected token ‘.‘ 报错解决办法

    问题原因: 用nvm1.1.7的版本安装了16.x以上的node, 然后再下载依赖的时候就报错了; 总结一下就是nvm版本太低了,他的里面没有集成高版本node导致的。 解决办法: 把nvm切换到新版本就行了。 1. 卸载掉当前所有的node 有3个版本的node,我们要nvm uninstall 16.18.1, nvm uninstall 16.12.2…

    2024年02月14日
    浏览(47)
  • npm ERR! node-pre-gyp

    npm i 的时候报 npm ERR! node-pre-gyp 错误,是因为node-gyp无法找到Python,可能是因为没有设置Python环境变量或者Python未安装; 一般js中引入canvas包的都需要Python去编辑底层 解决办法: 确认已安装 Python 环境,可以在命令行窗口输入 python --version 命令来确认版本。 如果未安装 Pytho

    2024年02月15日
    浏览(51)
  • npm install报错code ERR_SOCKET_TIMEOUT(proxy相关)

    proxy的问题,npm install换成: 原因: 当使用npm install命令安装依赖时,有时会因为网络问题或者代理问题导致连接registry超时,从而导致安装过程中出现ERR_SOCKET_TIMEOUT的错误。这时,重新指定registry可以解决这个问题,具体原因可能是npm的registry更新可能不及时,或者因为网络

    2024年02月14日
    浏览(51)
  • 【npm】npm install命令报错npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree

    一、现象: npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree 二、原因 ERESOLVE与npm@7有关的问题很常见,因为npm7.x对某些事情比npm6.x更严格。通常,最简单的解决方法是将–legacy-peer-deps标志传递给npm(e.g.,npm i --legacy-peer-deps),或者使用npm@6。 如果这不能立即起作用,

    2024年02月04日
    浏览(65)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包