首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >npm 安装过程中各种ERR问题处理

npm 安装过程中各种ERR问题处理

作者头像
zinyan.com
发布2023-07-14 10:45:10
发布2023-07-14 10:45:10
7.1K0
举报
文章被收录于专栏:zinyanzinyan

介绍

在使用npm过程中出现的问题记录,并附上相关的解决方法。

希望能够给小伙伴一些参考

1. npm ERR !gyp ERR !find Python

没有找到Python。npm依赖到了Python。我们需要主动在电脑中配置安装Python

可以直接使用Microsoft Store 搜索 Python3 进行下载安装即可

安装完毕后,在cmd中输入 python --version 就能看到相关版本了。

2. npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use

执行npm操作的时候出现错误:

代码语言:javascript
复制
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2019 (16.11.32228.343) found at:
npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - missing any VC++ toolset
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows

我们本地没有visual Studio C++ core features。也就是说没有安装Visual Studio

需要主动安装:

3.npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1

如果运行后出现了gyp错误,那么就代表我们的npm环境中gyp配置有问题。

解决,我们需要安装gyp

  1. 安装 npm install -g node-gyp
  2. 安装 npm install --global --production windows-build-tools
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-04-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 zinyan 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 介绍
  • 1. npm ERR !gyp ERR !find Python
  • 2. npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
  • 3.npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档