1.问题
# 1.添加Python27的安装路径到环境变量
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
# 2.未按照配置的环境变量找到python2
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python E:anaconda3envspython.EXE
真实原因:
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-83_binding.node"
2.处理
2.1 方案一【我的环境失败】
# npm设置国内地址
npm config set registry https://registry.npm.taobao.org/
npm config get registry
首先确认node的版本跟node-sass的版本是匹配的 https://github.com/sass/node-sass:
# 查询node版本
node -v
# 查询结果
v14.17.0
{
...
"node-sass": "4.14.1",
"sass-loader": "8.0.2",
...
}
解决方法,原文链接:https://blog.csdn.net/manonggeerdan/article/details/121260754:
# 1.删除工程的node_modules文件夹
# 2.以管理员身份打开dos窗口
# 3.安装node-gyp
npm install -g node-gyp
# 4.安装windows-build-tools
npm install --global --production windows-build-tools
这里可能出现的问题:
Visual Studio Build Tools一直处于“Still waiting for installer log file…”状态:
Status from the installers:
---------- Visual Studio Build Tools ----------
Still waiting for installer log file...
------------------- Python --------------------
Python 2.7.8 is already installed, not installing again.
npm install --global --production windows-build-tools --vs2015
# 安装成功
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Python 2.7.8 is already installed, not installing again.
Now configuring the Visual Studio Build Tools..
All done!
+ windows-build-tools@5.2.2
updated 1 package in 114.042s
2.2 方案二【成功】
Cannot download "https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-83_binding.node"
# 使用腾讯的云服务器进行下载
wget https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-83_binding.node
npm i node-sass@4.14.1 --sass_binary_site=E:yuanzheng-codebasecode-gitee-openopen_ruoyi_activitiruoyi-deploy -D
2.3 方案三【成功】
npm i node-sass@4.14.1 --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ -D
原文地址:https://blog.csdn.net/weixin_39168541/article/details/134082126
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_7561.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。