gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable.

安装node-sass报以下错误,这是由于缺少python环境,需要安装编译环境在这里插入图片描述
处理方案:
1.执行命令(安装了Yarn才可使用yarn命令)
npm install --global --production windows-build-tools

yarn global add --production windows-build-tools
添加windows 下node的Python的编译环境
在这里插入图片描述
2.执行命令安装node-sass指定版本(不输入版本号默认最新版)
npm install [email protected]

yarn add [email protected] --dev

查询node-sass各版本地址
https://www.npmjs.com/package/node-sass
在这里插入图片描述 出现完整目录,表示安装成功