Windows10系统安装Truffle框架,安装失败,提示:error An unexpected error occurred: “https://xxxxx

简介: Windows10系统安装Truffle框架,安装失败,提示:error An unexpected error occurred: “https://xxxxx

Windows10系统安装Truffle框架,安装失败集锦,提示:error An unexpected error occurred: "https://xxxxx


Windows10安装truffle框架需要满足下面两个条件

  1. 基础安装环境
  2. 用到npm或者yarn命令,择一。

一、基础安装环境(技术选型)

  • Solidity - 0.8.10 (solc-js)
  • Node v14.18.1
  • Web3.js v1.5.3
  • python3.7gyp需要)
  • msbuild
  • npm
  • yarn

以上环境的安装搭建大家可以自己查询资料和博客解决。(少一个不行)

二、npm命令或者yarn命令安装truffle

命令:

yarn global add truffle
npm install -g truffle

在这里我们选择第二个命令,用npm的方式安装。

三、遇到的问题

【1】==》yarn报错error An unexpected error occurred: "https://xxxxx

【2】==》info There appears to be trouble with your network connection. Retrying…

【3】==》fatal: unable to access 'https://github.com/…'的解决办法(亲测有效)

❤️分析:yarn命令安装出现这个错误主要是网络问题,再重新设置代理之后,yarn命令还是不能安装truffle,我的电脑不能正常访问github,需要更换淘宝镜像,但换了镜像依然不能,所以这里采用npm命令安装。

【4】==》npm install报错RunScriptError: post install error, please remove node_modules before retry!

❤️分析:这个问题主要是由于本机缺少msbuild 编译环境,可以重新安装Visualstudio2022代码集成编译器,也就是写C语言的工具。如下图所示:(因为Visualstudio2022集成了msbuild环境。)

❤️统一解决方案❤️:

npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist
  • 升级npm到最新版本:
npm i npm g
  • 安装truffle
npm install -g truffle
  • 验证truffle:

因为这里是Windows系统,所以需要使用到npx命令,在Linux环境中的话,不需要npx命令。

npx truffle
npx truffle version

如下图成功:

目录
相关文章
|
2月前
|
Ubuntu Linux Shell
(已解决)Linux环境—bash: wget: command not found; Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
(已成功解决)Linux环境报错—bash: wget: command not found;常见Linux发行版本,Linux中yum、rpm、apt-get、wget的区别;Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
669 68
(已解决)Linux环境—bash: wget: command not found; Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
|
2天前
|
Linux 网络安全 iOS开发
Metasploit Framework 6.4.49 (macOS, Linux, Windows) - 开源渗透测试框架
Metasploit Framework 6.4.49 (macOS, Linux, Windows) - 开源渗透测试框架
12 0
Metasploit Framework 6.4.49 (macOS, Linux, Windows) - 开源渗透测试框架
|
1月前
|
关系型数据库 MySQL Docker
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
|
2月前
|
安全 Ubuntu Linux
Metasploit Pro 4.22.6-2024111901 (Linux, Windows) - 专业渗透测试框架
Metasploit Pro 4.22.6-2024111901 (Linux, Windows) - 专业渗透测试框架
71 9
Metasploit Pro 4.22.6-2024111901 (Linux, Windows) - 专业渗透测试框架
|
2月前
|
Linux C# iOS开发
开源GTKSystem.Windows.Forms框架让C# Winform支持跨平台运行
开源GTKSystem.Windows.Forms框架让C# Winform支持跨平台运行
68 12
|
3月前
|
网络安全 Windows
Windows server 2012R2系统安装远程桌面服务后无法多用户同时登录是什么原因?
【11月更文挑战第15天】本文介绍了在Windows Server 2012 R2中遇到的多用户无法同时登录远程桌面的问题及其解决方法,包括许可模式限制、组策略配置问题、远程桌面服务配置错误以及网络和防火墙问题四个方面的原因分析及对应的解决方案。
239 4
|
3月前
|
存储 网络安全
Curl error (60): SSL peer certificate or SSH remote key was not OK for https://update.cs2c.com.cn/NS/V10/V10SP2/os/adv/lic/base/x86_64/repodata/repomd.xml [SSL: no alternative certificate subject name matches target host name 'update.cs2c.com.cn']
【10月更文挑战第30天】在尝试从麒麟软件仓库(ks10-adv-os)下载元数据时,遇到 SSL 证书验证问题。错误提示为:`Curl error (60): SSL peer certificate or SSH remote key was not OK`。可能原因包括证书不被信任、证书与域名不匹配或网络问题。解决方法包括检查网络连接、导入 SSL 证书、禁用 SSL 证书验证(不推荐)、联系仓库管理员、检查系统时间和尝试其他镜像。
920 1
|
6月前
|
API Docker Windows
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
这篇文章是一份关于Ollama工具的一站式使用指南,涵盖了在Windows系统上安装、使用和定制服务,以及实战案例。
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
|
6天前
|
安全 Unix 虚拟化
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
32 11
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 2 月更新)
|
6天前
|
Unix 虚拟化 Windows
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)
28 7
Windows Server 2025 中文版、英文版下载 (2025 年 2 月更新)