首页 > 编程语言 >Vue学习笔记之Vue项目启动gyp ERR! find Python

Vue学习笔记之Vue项目启动gyp ERR! find Python

时间:2023-06-08 18:22:49浏览次数:48  
标签:node npm Vue ERR Python gyp find

0x00 报错详细

该报错在Windows和MacOS平台均会出现,项目启动时候报错如下:

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 one rrorNT (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! [email protected] install: `node build.js || nodejs build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

 

0x01 解决方法

1.1 安装node-gyp

npm install -g node-gyp

1.2 安装python

推荐安装2.7版本(自行选择32位或者64位安装), 选择官方python2.7最后更新版本:

 

0x02 参考

gyp ERR! find Python 解决方案

 

标签:node,npm,Vue,ERR,Python,gyp,find
From: https://www.cnblogs.com/JetpropelledSnake/p/17467344.html

相关文章

  • vue3 祖孙通信
    利用provide和inject  provide用于向子组件(或子组件中的子组件,无限嵌套)提供自身的一些数据,或者将自身所有属性全部提供,但是提供的数据均为非响应式数据。 inject用于引入父级组件所提供的数据 1、祖父组件import{ref,reactive,provide}from"vue";constgrandFat......
  • 报错:[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined
    1.错误详情2.错误分析百度此错误发现,很多人可能忘记在main.js中引入store.js并挂载在vue实例上,或者state单词写错了我审查了很多遍代码,依然报错,读取不到state中的数据,后来想到可能是版本的问题此项目是vue2,要使用vuex3才能正常运行,我安装的时候没有指定版本,直接装的是最新的v......
  • 手把手教你用Python做一个图像融合demo,小白可上手!
    1.创作背景说到融合,一下子会让我们这些95后想起来童年的动漫游戏王了!发动魔法卡——融合!哈哈,今天说得当然不是游戏王里的魔法了,但是我们使用的是Python魔法,今天我们将使用Python编程语言,以及自带的图像处理工具包进行图像融合操作,来实现图像融合的酷炫效果!前几天在网上看了一个dem......
  • 关于项目报错“Error running 'All in IIDCNo junit.jar”
    在我跑一个项目的时候遇到了如图所示问题去网上搜,搜到了类似的解决方案,如下解决方法运行之后出现新的问题......
  • Vue组件和Vue实例的理解
    关于VueComponent:1、组件本质是一个名为VueComponent的构造函数,并且不是程序员定义的,是Vue.extend生成的2、我们只需要写组件引入<Demo/>,Vue解析时会帮我们创建demo组件的实例对象,即Vue帮我执行的:new VueComponent(options)3、特别注意:每次调用Vue.extend,返回的都是一个全......
  • Python实际应用,处理字幕文件实现句首字母大写
    #Python实际应用,处理字幕文件实现句首字母大写。读取文件lower.txt,实现句首字母大写,将处理结果输出到Upper.txt文件infile=open("lower.txt","r")#打开输入文件outfile=open("Upper.txt","w")#打开输出文件flag=True#需要处理首字母大写的行标志,默认首行......
  • jquery:TypeError: $(...).on is not a function
    当发生错误TypeError:$(...).onisnotafunction时,当不存在javascript类冲突的前提下,考虑是否是因为jquery版本过低! 参考:http://stackoverflow.com/questions/15670352/typeerror-on-is-not-a-functionhttp://stackoverflow.com/questions/18958775/typeerror-jquery-on-is-n......
  • 实验6 turtle绘图与python库应用编程体验
    task1-1fromturtleimport*defmove(x,y):penup()goto(x,y)pendown()defdraw(n,size=100):foriinrange(n):fd(size)left(360/n)defmain():pensize(2)pencolor('red')move(-200,0)draw......
  • Python使用os模块创建带时间戳的文件
    直接上源码:importosimporttime#定义函数名:在py文件路径下创建cache的txt文件deftxt(name,text):#os.getcwd()获取当前的工作路径;new=os.getcwd()+'/cache/'#判断当前路径是否存在,没有则创建new文件夹ifnotos.path.exists(new):......
  • uniapp+微信小程序+vue3 实现富文本编辑器遇到的坑
     问题一:富文本编辑器初始化实例出不来,有两个原因:找的参考代码不适用微信小程序,需要用.in(this)uni.createSelectorQuery().in(this).select("#editor").context(res=>{this.editorCtx=res?.context;}).ex......