执行npm install 的时候出现:fatal: unable to access ‘https://github.com/nhn/raphael.git/‘: OpenSSL SSL_connect: Connection was
温馨提示 如果使用ali镜像也可能出现这种情况,那么这个时候改成npm install 试试。
Failed to connect to github.com port XXX 是连接XXX端口失败:多数是因为你设置代理了,查看代理:
git config --global http.proxy
看到:127.0.0.1:1080
取消代理:
git config --global --unset http.proxy
清除完代理之后要刷新dns,不然可能出现:fatal: unable to access ‘https://github.com/nhn/raphael.git/‘: OpenSSL SSL_connect: Connection was
温馨提示:使用阿里镜像也可能出现上面情况,这时候改用npm install 试试
在终端键入:
ipconfig /flushdns
然后在执行npm install或者附带阿里镜像的 npm install:
npm install
npm install --registry https://registry.npm.taobao.org
然而,还有错:
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (E:\ideaWorkSpace2\datax-web-ui-master\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (E:\ideaWorkSpace2\datax-web-ui-master\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at callback (E:\ideaWorkSpace2\datax-web-ui-master\node_modules\graceful-fs\polyfills.js:299:20)
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:168:21)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\ideaWorkSpace2\\datax-web-ui-master\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--lib
sass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd E:\ideaWorkSpace2\datax-web-ui-master\node_modules\node-sass
gyp ERR! node -v v12.18.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
网上查的很多解决方案是:执行命令:
cnpm install --global --production windows-build-tools
这个工具应该是集成了python环境。
看到结果:
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!Status from the installers:
---------- Visual Studio Build Tools ----------
Still waiting for installer log file...
------------------- Python --------------------
Successfully installed Python 2.7
但是,我执行之后还是不行,仔细查看报错日志:
发现上面的命令安装的Python目录不是C:/python27
所以我自己安装并且配置了python环境变量,要把python安装在上面的截图标记的位置,并且是Python2.7。
继续运行npm install
出现;
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Visual Studio 2005;或 3) 如果将该组件安装到了其他位置
,请将其位置添加到系统路径中。 [E:\ideaWorkSpace2\d
atax-web-ui-master\node_modules\node-sass\build\binding.sln]
这个时候再运行
cnpm install --global --production windows-build-tools
这时候python已经安装好了,就直接装vs了:但是一直处于下面的等待状态:
解决办法;到这里下载安装(直接安装即可)
.NET SDKs downloads for Visual Studio
然后在执行:
npm install --global --production windows-build-tools@3.0.0
结果可以:
执行npm install:
可以了现在。
运行npm run dev:
访问网址。