configure errorgyp ERR stack Error: Can‘t find Python executable 以及npm ERR code ELIFECYCLE

在执行npm install命令时,出现两处错误:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python2.7", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (E:\IdeaProjects\edu\front\vue-element-admin-master\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (E:\IdeaProjects\edu\front\vue-element-admin-master\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack     at callback (E:\IdeaProjects\edu\front\vue-element-admin-master\node_modules\graceful-fs\polyfills.js:306:20)
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.19044
gyp ERR! command "E:\\node.js\\node.exe" "E:\\IdeaProjects\\edu\\front\\vue-element-admin-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\IdeaProjects\edu\front\vue-element-admin-master\node_modules\node-sass
gyp ERR! node -v v10.14.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

以及

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm 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!     C:\Users\dell\AppData\Roaming\npm-cache\_logs\2022-04-10T16_23_29_217Z-debug.log

百度了挺多方法都没有解决问题,最后还是让我找到了,最后使用以下命令解决了问题:

//设置全局镜像源:
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/

Node版本是v10.14.2,npm版本是对应的6.4.1版本

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值