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月前
|
API Docker Windows
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
这篇文章是一份关于Ollama工具的一站式使用指南,涵盖了在Windows系统上安装、使用和定制服务,以及实战案例。
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
|
2月前
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
|
2月前
|
Linux Python Windows
【Azure 环境】Windows中安装Python azure-eventhub-checkpointstoreblob-aio模块时出错 ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:
【Azure 环境】Windows中安装Python azure-eventhub-checkpointstoreblob-aio模块时出错 ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:
|
2月前
|
网络安全 Apache Windows
网站⭐Windows下,将xampp升级为https
网站⭐Windows下,将xampp升级为https
|
4月前
|
开发工具 git
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
327 1
|
5月前
|
机器学习/深度学习 安全 数据安全/隐私保护
Windows系统安装Jupyter Notebook并实现公网访问内网笔记服务
Windows系统安装Jupyter Notebook并实现公网访问内网笔记服务
|
4天前
|
边缘计算 安全 网络安全
|
1月前
|
网络安全 虚拟化 Windows
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
|
2月前
|
开发框架 .NET API
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
Windows Server 2022 安装IIS 报错 访问临时文件夹 C:\WINDOWS\TEMP\3C 读取/写入权限 错误: 0x80070005
106 0
|
2月前
|
Linux Docker Windows
Windows——Docker拉取Windows Server镜像
Windows——Docker拉取Windows Server镜像
116 0