下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

这篇具有很好参考价值的文章主要介绍了下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

报错界面如下:

下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

问题:not looking for VS2013 as it only supported up to Node.js 8

解决方案:

you need to install the lastest version of version of Visual Studio
你需要下载最新的Visual Studio

找到GitHub地址:https://github.com/nodejs/node-gyp
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

下载Vistual Studio链接:https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=BuildTools

下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

不要立刻就去选择c++桌面开发,这样下载的会是Vistual Studio生成工具2022,这个下载之后,还是会出错

没有选择windows SDK
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

Vistual Studio生成工具2022下载还是不行
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

下载Vistual Studio2017, 让windows支持c++编译环境

关闭弹窗,选择可用里面的Vistual Studio2017,社区版,个体开发人员就足够了
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

看清楚是Vistual Studio2017,我已经安装过了,所以截图时是修改状态
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

勾选一个windows sdk

一定要勾选一个windows sdk
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

npm config set msvs_version 2017

然后cmd输入:npm config set msvs_version 2017,然后就可以在项目工程里安装node-gyp了

如果还是出错,像下面这样报错,可能是node版本过高导致的
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

降低node版本,可以用nvm管理node版本

下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config

使用稳定版就v14.17.0就很完美了
下载: nvm add v14.17.0
使用:nvm use v14.17.0
下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config文章来源地址https://www.toymoban.com/news/detail-489525.html

总结:

  1. windows没有c++编译环境,所以要下载Vistual Studio
  2. windows没有设置msvs_version,所以下载之后,还需要使用命令行设置
  3. 注意node版本

到了这里,关于下载node-gyp依赖包报错:gyp ERR! find VS msvs_version not set from command line or npm config的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • npm install 报错 ERR! gyp ERR! node-sass python

    一、问题描述: npm install 报错 ERR! gyp ERR! ERR! stack Error: Can\\\'t find Python executable \\\"python\\\", you can set the PYTHON env variable node -v v16 node-gyp -v v3.8.0 二、可能原因 1 nodejs与sass版本不匹配(可能性最大:解决办法见三) node版本是16,sass版本是4.14。重装的node ,就好了。其他两个是调查时看到

    2024年02月03日
    浏览(40)
  • electron 使用node C++插件 node-gyp

    node C++插件使用,在我们常规使用中,需要使用node-gyp指定对饮的node版本即可 在electron的使用中,我们需要指定的是electron版本要不然会报错使用的v8内核版本不一致导致C++扩展无法正常引入 electron官方文档-node原生模块 package.json 下面是我实现的调试编译bat脚本提供你参考

    2024年02月13日
    浏览(32)
  • npm install齐天大坑!!!gyp ERR! find VS msvs_version not set from command line or npm config

    1、卸载nodejs重新安装一遍 2、设置淘宝镜像 npm config set registry https://registry.npm.taobao.org 3、安装nodejs所需的环境(Visual Studio XX、python什么鬼的),执行这个命令会自动检测并帮你安装好,npm install --g --production windows-build-tools 4、关键所在!!!执行编译时指定python版本,npm ins

    2024年02月13日
    浏览(42)
  • 解决npm install报错 npm ERR! gyp ERR! cwd D:\Projec\xxx\node_modules\node-sass (node-sass版本问题)

    vue项目换电脑后npm install发现一直报如下的错误: node-sass版本不兼容,比较老。还出现找不到python路径的错误。node-sass 需要 node-gyp安装时需要进行转译所以可能会出现各种按安装问题。且node-sass 本身就已经是deprecated状态了。如果不是维护老项目不建议再使用 由于它只用于开

    2024年02月09日
    浏览(45)
  • Node.js 配置 node-gyp 时报错 msvs_version / python is not a valid npm option 的解决方案

    此文章为原创文章,如转载请标明原作链接。 https://blog.csdn.net/qq_34718871/article/details/128731097 本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 (CC BY-SA 4.0) 进行许可。 当我尝试使用如下命令设置 node-gyp 环境时, 发生了报错,主要部分如下: 在设置 python 时也遇到了同样

    2024年02月05日
    浏览(34)
  • npm ERR! node-pre-gyp

    npm i 的时候报 npm ERR! node-pre-gyp 错误,是因为node-gyp无法找到Python,可能是因为没有设置Python环境变量或者Python未安装; 一般js中引入canvas包的都需要Python去编辑底层 解决办法: 确认已安装 Python 环境,可以在命令行窗口输入 python --version 命令来确认版本。 如果未安装 Pytho

    2024年02月15日
    浏览(39)
  • gyp ERR!报错解决

    项目安装依赖包的时候,多次出现gyp ERR!或者node-pre-gyp ERR!这种错,记录一下最近遇到的报错:  用过两次这种解决办法,都能把依赖下好,项目跑起来   运行上面命令最好先删除node_modules,不然可能会报错 删除命令如下: 还有一种办法,我没试过,先写着,万一以后遇到

    2024年02月11日
    浏览(35)
  • npm install运行报错npm ERR! gyp ERR! not ok问题解决

    执行 npm install 的时候报错: 根据报错信息,看出时node-sass运行出现问题 解决: 1.查看当前环境node版本 我这里是20.11.0 2.在package.json中查看node-sass的版本: 2.1package.json中有node-sass 我这里node-sass的版本是4.14.4 根据下图查看node和node-sass版本是否匹配 如果node和node-sass版本不符合

    2024年01月24日
    浏览(42)
  • npm 装包报错 npm ERR cb() never called npm ERR This is an error with npm itself. Please report this

    node.js 版本过高 Vue2 项目使用 12开头 的 Node.js版本 ,Vue3项目使用 16开头 的 Node.js 版本(我 Vue2 用 12.18.0,Vue3 用 16.14.0) 同时按下 Win+R 键后输入 cmd ,然后回车打开小黑窗,输入 node -v 方法一:重装 Node ( 不推荐 ) 不推荐这个方法 ,想切换 node 版本又得卸载重装,很不方便

    2024年02月12日
    浏览(31)
  • python安装matplotlib包报错:ERROR: Could not find a version that satisfies the requirement matplotlib

    一个项目需要用到matplotlib包,但是发现之前没有安装过,故习惯性按照如下方法尝试安装 file-setting-project:项目名python interpreter-搜索 matplotlib-install-报错 ERROR: Could not find a version that satisfies the requirement matplotlib (from versions: none)ERROR 结果报错版本不匹配。。下面开始找解决方法

    2024年02月08日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包