本文介绍: 缺少很多node.js相关开发工具依赖比如python、Visual Studiogyp等等。gyp ERR! find VS msvs_version not set from command line or npm configgyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Promptgyp ERR! find VS could not use PowerShell to find Visual Studio

一、遇到问题

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://blog.csdn.net/m0_52861000/article/details/132914900

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_33466.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注