You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下npm安装web3包时遭遇LNK1181致命错误求助

Fixing Web3 Installation Errors on Windows (LNK1181 + Deprecation Warnings)

Hey there! Let's work through this web3 installation issue you're facing on Windows. First, let's break down the problems and tackle them one by one.

Dealing with the Deprecation Warnings

Those npm warnings about fs-promise@2.0.3 and tar.gz@1.0.7 are just alerts that some older dependency packages used by web3 have been replaced with newer, better alternatives (like mz/fs-extra for promise support, and updated tar utilities).

They don’t block the installation, but if you want to avoid them long-term, try upgrading to the latest stable version of web3.js—most modern releases have already swapped out these deprecated packages.

Fixing the Fatal LNK1181 Error

This error means the linker can’t find a required input file, which usually ties back to incomplete or misconfigured Windows build tools. Here’s how to fix it:

  • Verify your Windows Build Tools are fully installed
    The windows-build-tools package sometimes misses critical components. Open the Visual Studio Installer (if you have Visual Studio or Build Tools installed) and make sure the Desktop development with C++ workload is checked, including:

    • MSVC v14x Build Tools (match your installed version)
    • Windows 10/11 SDK (appropriate for your OS)
    • C++ CMake tools for Windows (optional but helpful)

    If you didn’t install via the Visual Studio Installer, re-run the build tools command with explicit version targeting (e.g., for VS2017):

    npm install --global --production windows-build-tools --vs2017
    
  • Configure npm to use the correct MSVC version
    Tell npm which version of Visual Studio build tools to use with this command (replace 2017 with your installed version if different):

    npm config set msvs_version 2017
    
  • Clean and reinstall
    Corrupted cache or partial installs can cause issues. Run these steps in order:

    1. Clear the npm cache:
      npm cache clean --force
      
    2. Delete your project's node_modules folder and package-lock.json file
    3. Reinstall web3 (or your full dependencies):
      npm install web3
      
  • Run commands as Administrator
    Sometimes permission issues prevent the linker from accessing necessary files. Open Command Prompt or PowerShell as Administrator before running the install commands.


内容的提问来源于stack exchange,提问作者zlikar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 12:04:40