问题描述?执行npminode-sass-D关键字说明:tunnelingsocketcouldnotbeestablished,cause=getaddrinfoENOTFOUND49402//这个端口号可能每个人都不一样Error:CouldnotfindanyPythoninstallationtouse...说明如果遇到这些问题,你应该都能在这里找到答案。为什么最终报告中的错误信息会有Python提示?本地编译binding.node,过程需要使用python。为什么下载失败?在执行npminstallnode-sass时,控制台会看到正在从github上下载一个win32-x64-72_binding.node文件,这是一个二进制文件,npm仓库中不存在该文件,而是直接从github上下载的。下载速度很慢。如果当地没有墙,失败的几率会比较高。解决下载慢的5个方法。所有依赖都设置为淘宝镜像npmconfigsetregistryhttps://registry.npm.taobao.org/只为node-sass设置pull地址npminstallnode-sass--sass-binary-site=https://npm.taobao.org/mirrors/node-sass3。在npm配置设置npmconfigsetsass_binary_sitehttps://npm.taobao.org/mirrors/node-sass4.在package.json"nodeSassConfig":{"binarySite":"https://npm.taobao.org/mirrors/node-sass"},5.在项目目录下新建.npmrc文件registry=https://registry.npm.taobao.org/#搭建私服@pm:registry=http://192.168.1.200:8081/repository/npm/#例如安装npminstall@pm/axios-Snpminstall@pm/vue-S以上没有解决问题,解决端口号问题我的电脑报:49402查看npm配置npmconfiglist-l//查看所有npm配置,查看是否有代理字段,如果有删除npmconfigdeleteproxynpmconfigdeletehttps-proxy查看环境变量,发现这里有一个49402端口,删除它已经解决了。node-sass安装问题补充下载文件到本地方法目前验证失败,先从https://npm.taobao.org/mirrors/node-sass下载一个node-sass版本,然后在本地npmchche下载目录,比如我的电脑目录C:\Users\YXS\AppData\Roaming\npm-cache\node-sass然后设置npmconfigsetsass-binary-siteC:/Users/YXS/AppData/Roaming/npm-cache/node-sass#查看是否生效npmconfiglist-l然后安装npminode-sass@4.10.0-DWindows系统操作系统管理员权限执行以下命令npminstall--global--productionwindows-build-toolsCurrentlyverificationfails临时CMD代理后,如果需要为cmd临时设置代理,可以使用如下命令行。这个环境变量只会持续到cmd窗口关闭,不是系统环境变量sethttp_proxy=http://127.0.0.1:1080sethttps_proxy=http://127.0.0.1:1080更有用的知识https://blog。csdn.net/weixin_38384296/article/details/116403848
