解决node-gyp安装vuetify编译失败gyp ERR问题 - Go语言中文社区

解决node-gyp安装vuetify编译失败gyp ERR问题


问题

在安装 vuetify 的时候发现了 node-gyp 编译失败的问题,报错很友好:


gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.8.0 | win32 | x64
gyp info find Python using Python version 3.8.5 found at “D:Program FilesPython38python.exe”
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the “Desktop development with C++” workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************


就是说找到了我们的 python 3.8 环境,还缺少 vs 环境,我们去他提示的 https://github.com/nodejs/node-gyp#on-windows 看一下

在这里插入图片描述

我们不希望安装整个 vs ,太过于臃肿,所以我们选择第一种方案。

解决

这里使用 npm 做全局安装,使用 yarn 不能安装,如果 npm 太慢可以在这里先配置一下淘宝镜像源。

	npm install --global --production windows-build-tools

之后会输出正在安装 python 2.7 :

在这里插入图片描述

还需要一套 vs 开发 sdk ,他会静默安装,请耐心等待 C 盘空间减少 4 G 左右不再发生变化即可。

我们可以在系统程序管理中看到刚刚安装的依赖:

在这里插入图片描述

管理安装的依赖

在开始菜单使用 vs 安装工具可以管理已经安装的依赖,方便以后卸载:

在这里插入图片描述
可以看到安装了 2017 生成工具:

在这里插入图片描述

检查 C 盘

静默安装我们不知道安装到哪里了,检查一下 C 盘确认一下位置。

C:Program Files (x86) 有 3.7 G 的依赖。

在这里插入图片描述

C:ProgramData 有 500 M 的数据。

在这里插入图片描述

一共 4 G 多。

重新安装

重新安装 vuetify ,这里使用 yarn 安装也可以(上面的构建工具必须使用 npm 安装):

在这里插入图片描述

成功安装!

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/qq_21567385/article/details/108307529
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢