gyp verb check python checking for Python executable “python2“ in the PATH

当我们的前端项目中用到 node-sass 时,有时候汇报这个错:

gyp verb check python checking for Python executable “python2” in the PATH

1.先看看我们系统的python 是什么版本
python --version
#  3.x.x

如果是 3.x 版本的,需要装一个 2.x版本

2. 执行以下命令:
npm install --global windows-build-tools
3. 配置环境变量

python 的安装目录: Python2成功安装到C:\Users\JourneyOfFlower.windows-build-tools\python27\
你的肯定不在这里,自己找找吧
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

4. 删除原有的node_modules,重新装
yarn
5.启动
npm run

猜你喜欢

转载自blog.csdn.net/fth1002853070/article/details/132479133