npm install齐天大坑!!!gyp ERR! find VS msvs_version not set from command line or npm config

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

报错信息:


```bash
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017"
gyp ERR! find VS - will only use this version
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 looking for Visual Studio 2013
gyp ERR! find VS - not found
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
gyp ERR! stack     at VisualStudioFinder.fail (D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstu
dio.js:121:47)
gyp ERR! stack     at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack     at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at D:\rymcu\electron-serialport\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:310:5)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
gyp ERR! System Windows_NT 10.0.15063

解决办法

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
gyp err! find vs,npm,前端,node.js
4、关键所在!!!执行编译时指定python版本,npm install --python=python2.7

由于我的电脑之前安装过python3版本,并且设置了环境变量,所以npm install会找我默认的python,所以执行时指定nodejs只支持的python2版本。

然后,神奇的事情到了,我把编译包modules删掉后重新编译(这次不指定python2版本直接npm install),居然奇迹般的又没有报错!!!想不通。。。难道npm会将上次编译成功的配置保存下来??算了不纠结了哭泣!文章来源地址https://www.toymoban.com/news/detail-534226.html

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

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

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

相关文章

  • 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 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)
  • 解决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)
  • 解决 npm ERR! node-sass 和 gyp ERR! node-gyp 报错问题

    如果你机器里的node版本太高,又不想卸载重新安装低版本的node,可以安装一个 NVM 版本管理工具,随时切换node版本 1.下载安装nvm:nvm for windows 2.安装nvm后在命令窗口输入命令 nvm,出现一堆提示文字后成功。 3.执行安装node版本命令 安装指定版本(以14.18.3为例) 一些nvm常用命

    2023年04月08日
    浏览(36)
  • 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)
  • npm install 报错 gyp 解决方案

    问题: 接手别人的项目,在安装项目依赖 npm install 时,一直提示 gyp 相关的错误。 问题原因: 项目中依赖项 \\\"node-sass\\\": \\\"^4.14.1\\\", 与当前node.js版本不符合。 解决问题: 通过百度踩坑,发现在使用 \\\"node-sass\\\": \\\"^4.14.1\\\" 时, node.js 版本应为: 14.19.2 1、nvm 安装 我使用的是v1.1.11的n

    2024年02月11日
    浏览(58)
  • 解决npm install报错: No module named gyp

    今天运行一个以前vue项目,启动时报错如下:  ERROR  Failed to compile with 1 error上午10:19:33  error  in ./src/App.vue?vuetype=styleindex=0lang=scss Syntax Error: Error: Missing binding D:javacodeSpringboot-MiMall-RSAVueFrontnode_modules_node-sass@4.14.1@nod         e-sassvendorwin32-x64-83binding.node Node Sass could not

    2024年02月10日
    浏览(42)
  • npm install报错npm ERR! code ERESOLVE

    1.npm install报错npm ERR! code ERESOLVE 解决方法 在npm install 后面加上–force或者–legacy-peer-deps 2.npm install 报错 gyp ERR 原因:node和npm版本不匹配 解决方法 1.首先去node官网查找对应版本 node官网版本 2 查看自己电脑的node、npm版本,win+r打开cmd,输入: 卸载原有的高版本node,下载安装

    2024年02月15日
    浏览(34)
  • npm install出现npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve

    PS E:myvuebookshop npm i npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR!  npm ERR! While resolving: @vue/eslint-config-standard@6.1.0 npm ERR! Found: eslint-plugin-vue@8.7.1 npm ERR! node_modules/eslint-plugin-vue npm ERR!   dev eslint-plugin-vue@\\\"^8.0.3\\\" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! p

    2024年02月11日
    浏览(33)
  • npm install 出现 npm ERR! command failed 解决办法

    本地使用npm install 时出现如下异常,可以看下本地是否安装过历史版本的node导致的版本冲突。 解决方案: 先将历史版本的 node 卸载,再重新安装后,再执行npm install  转自下面这篇文章 npm install 时 node-sass npm ERR command failed问题解决

    2024年02月12日
    浏览(43)

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

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

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

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

二维码1

领取红包

二维码2

领红包