网上去下载了一个demo,在本地安装npm包的时候报错; Error: Can't find Python executable "python", you can set the PYTHON env variable.
网上大部分都说是切换淘宝镜像源,但是早就切换了,所以肯定不是这个问题。想了想其他项目的node sass也是正常可以安装的,所以排除了因为python依赖的问题。
百度了很多文章感觉可能是因为node-sass和node版本不匹配,node-sass和node版本匹配见:https://github.com/sass/node-sass/releases 果然这个demo的node-sass版本是3.13.0,我的node版本是12.16.1
直接在packages.json中修改node-sass到4.14.1 然后重新执行npm install 成功安装。