首页 前端知识 解决(gyp、python等问题):gyp ERR! find VS msvs_version not set from command line or npm config

解决(gyp、python等问题):gyp ERR! find VS msvs_version not set from command line or npm config

2024-08-08 22:08:23 前端知识 前端哥 621 515 我要收藏

一、遇到问题

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, try re-running with '--loglevel silly' for more details
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 **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use

二、出现问题的原因

就是这个项目缺少很多node.js相关的开发工具和依赖,比如python、Visual Studio、gyp等等

三、解决办法

1.先设置npm的源为国内的淘宝镜像源

npm config set registry https://registry.npm.taobao.org

 

2.执行这个命令自动检测下载python、Visual Studio等等这些需要的东西。

npm install --g --production windows-build-tools

这个命令是用于在 Windows 操作系统上安装 windows-build-tools 包,它是一个 Node.js 模块,用于安装和配置在 Windows 上构建 Node.js 模块所需的开发工具和依赖项 

下载完成后使用快捷键CTRL+C结束当前的命令 

转载请注明出处或者链接地址:https://www.qianduange.cn//article/15057.html
评论
发布的文章

jQuery

2024-01-31 12:01:10

JQuery操作DOM

2024-04-13 23:04:28

jQuery入门(五)Ajax和json

2024-08-16 22:08:14

Aristo jQuery UI 主题教程

2024-08-16 22:08:14

常用js库和框架(echarts)

2024-08-16 22:08:08

ECharts基础配置详解

2024-08-16 22:08:07

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!