node-gyp安装

当前环境

  • win10
  • npm v10.7.0
  • node v18.20.3

安装chocolatey

powershell管理员安装:

1
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

耐心等待,过程涉及到下载,需要一定耗时。

详见官网

安装环境相关

1
choco install python visualstudio2022-workload-vctools -y

详见node-gpy README

npm安装node-gyp

1
npm install -g node-gyp