npm install报错Cannot download "https://github.com/sass/node-sass/releases/download/v4.12.0/win32-x64-

npm install 报错,一大片红色ERR:

看到前面有一句:
Cannot download “https://github.com/sass/node-sass/releases/download/v4.12.0/win32-x64-64_binding.node”:

gyp ERR! stack Error: Can’t find Python executable “python”, you can set the PYTHON env variable.
在这里插入图片描述在这里插入图片描述
网上找贴,解决方案,亲测有效:

(1)运行: npm uninstall node-sass 卸载安装失败的node-sass
(2)运行: npm install -g node-gyp
(3)运行: npm install --global --production windows-build-tools

注:可能报很多npm ERR!,我没管,后面依旧能运行。

(4)运行: npm install node-sass 重新安装
(5)最后重新运行:npm install 即可

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44671176/article/details/103493274