gyp ERR! configure error gyp ERR! stack Error: Can‘t find Python executable “python“
Posted 单身girl
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gyp ERR! configure error gyp ERR! stack Error: Can‘t find Python executable “python“相关的知识,希望对你有一定的参考价值。
报错内容 :第一个报错
gyp ERR! configure error
gyp ERR! stack Error: Can’t find Python executable “python”, you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython
报错内容第二个
Starting installation…
Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@5.2.2 postinstall: node ./dist/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@5.2.2 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\\gao13\\AppData\\Roaming\\npm-cache_logs\\2021-07-14T06_58_50_061Z-debug.log
解决方案:
输入 npm install --global --production windows-build-tools
1 安装python2.7,然后添加到环境变量
2 运行 npm install -g node-gyp
3 运行 npm install --global --production windows-build-tools 可以自动安装跨平台的编译器
4重新执行 npm install即可
第三个报错:
vue执行npm run servr 报错:ERROR in ./xxx/xxx.vue?vue&type=style&index=0&lang=css
解决第一步:node-sass npm i node-sass --S
不成功的话第二步:npm install sass-loader --save-dev
还是同样的报错的话试一下删除依赖和package-lock.json
然后从新安装依赖按照正常启动顺序启动项目
突然发现第四个报错问题 :postcss-html报错
解决方案:package.Json 加上 “postcss-html”: “^0.36.0”,
然后删除nodemoudles 和 package-lock.json 重新安装
以上是关于gyp ERR! configure error gyp ERR! stack Error: Can‘t find Python executable “python“的主要内容,如果未能解决你的问题,请参考以下文章
如何解决node升级到 8.x.x 以上版本后 gyp ERR! build error问题
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/bcrypt/.node
npm install时报错gyp ERR! stack Error: Can't find Python executable "2.7"
npm i安装包依赖时 gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env(
npm i安装包依赖时 gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env