crm开发定制Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.解决办法

😦crm开发定制电脑磕坏了

   crm开发定制最近把公司给的maccrm开发定制屏幕给磕坏了,crm开发定制换成自己的,本来想用时间机器做个无缝衔接,结果发现不能用了,跟客服沟通被告知macos版本在11以上不支持时间机器系统迁移,只能使用迁移助理做数据备份,非常痛苦!!!要重新安装各种环境,各种软件!!!!😤😤😤😤😤

🌟🌟🌟努力安装软件

   安装了很多开发常用的工具,就不一一罗列了。还有各种环境配置,经过两天的时间,差不多达到了以前环境的80%,还有一些细节需要优化,工欲善其事,必先利其器。
   于是我开始跑前端项目,安装完了nodejs,当我用npm i编译时,给我来了一大段报错

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.gyp ERR! stack     at PythonFinder.failNoPython (/Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/node-gyp/lib/configure.js:484:19)gyp ERR! stack     at PythonFinder.<anonymous> (/Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/node-gyp/lib/configure.js:406:16)gyp ERR! stack     at F (/Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/which/which.js:68:16)gyp ERR! stack     at E (/Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/which/which.js:80:29)gyp ERR! stack     at /Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/which/which.js:89:16gyp ERR! stack     at /Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/isexe/index.js:42:5gyp ERR! stack     at /Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/isexe/mode.js:8:5gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:192:21)gyp ERR! System Darwin 21.5.0gyp ERR! command "/usr/local/bin/node" "/Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="gyp ERR! cwd /Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/node-sassgyp ERR! node -v v14.17.3gyp ERR! node-gyp -v v3.8.0gyp ERR! not okBuild failed with error code: 1npm WARN @babel/plugin-proposal-class-static-block@7.18.0 requires a peer of @babel/core@^7.12.0 but none is installed. You must install peer dependencies yourself.npm WARN @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.17.12 requires a peer of @babel/core@^7.13.0 but none is installed. You must install peer dependencies yourself.npm WARN @babel/helper-define-polyfill-provider@0.2.4 requires a peer of @babel/core@^7.4.0-0 but none is installed. You must install peer dependencies yourself.npm WARN @babel/helper-define-polyfill-provider@0.3.1 requires a peer of @babel/core@^7.4.0-0 but none is installed. You must install peer dependencies yourself.npm WARN diboot-element-admin@2.3.1 No repository field.npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the node-sass@4.14.1 postinstall 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!     /Users/scott/.npm/_logs/2022-06-08T09_20_09_286Z-debug.logscott@ScottdeMacBook-Pro workflow-frontend-elem % npm install --save-dev node-sassnpm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.> node-sass@4.14.1 install /Users/scott/project/dx_project/front_project/workflow-frontend-elem/node_modules/node-sass> node scripts/install.jsDownloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/darwin-x64-83_binding.node
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39

发现一段错误提示Error: Can‘t find Python executable “python“, you can set the PYTHON env variable,这提示貌也很明显,告诉我们没有python,我在终端检查了一下果然没有。
我记得是自带python2.7的,于是我查阅了一下资料,发现Moterey这个版本的操作系统移出了python,需要自己去安装。好吧,认命,我装。
于是我开始使用homebrew安装python3.X。

# 命令大概是这样子brew install python3brew link python3
  • 1
  • 2
  • 3

细心的我观察到报错时调用的是’python’命令,于是在.bash_profile中增加了别名配置

alias python3='/usr/bin/python3'alias python=python3alias python2=python3
  • 1
  • 2
  • 3

满心欢喜继续执行npm i 进行编译项目,结果还是报错😫😫😫,不过细心的我肯定会注意到这一句提示Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/darwin-x64-83_binding.node,这个node-saas从github去拉,没有拉下来。我不是已经改过了镜像源了么,于是我又查阅了一些资料。于是乎查到了一个命令。

👊👊终极解决方案

没错,我们需要改变它的下载地址👏👏,通过下面这个命令把下载地址改为淘宝镜像。

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass
  • 1

可以看到已经下载好了,这时候我们就可以正常的npm install了,所以有时候遇到问题不要慌,这个解决不了,那么就先解决下一个。🏃🏃只要你跑的够快,bug就追不上你。
点赞收藏,富婆包养

网站建设定制开发 软件系统开发定制 定制软件开发 软件开发定制 定制app开发 app开发定制 app开发定制公司 电商商城定制开发 定制小程序开发 定制开发小程序 客户管理系统开发定制 定制网站 定制开发 crm开发定制 开发公司 小程序开发定制 定制软件 收款定制开发 企业网站定制开发 定制化开发 android系统定制开发 定制小程序开发费用 定制设计 专注app软件定制开发 软件开发定制定制 知名网站建设定制 软件定制开发供应商 应用系统定制开发 软件系统定制开发 企业管理系统定制开发 系统定制开发