2

This problem has troubled almost all front-end developers, and I have a headache every time I change my computer. Just refresh the record.

  1. Install the specified version of python
    Download address: https://www.python.org/downloads/windows/
  2. Install Visual C++ (you need to install Visual Studio first)
    Download address: https://visualstudio.microsoft.com/zh-hans/downloads/
    Select the desktop development C++ runtime library in Visual Studio and install it
    image.png
  3. Configure python environment variables
    Add in Path: C:/Python2.7
  4. Open cmd, configure Visual Studio version and python version

     npm config set msvs_version 2022
     npm config set python python2.7

After the above 4 steps, basically all the installation and configuration are completed. Next, you can successfully install nodejs libraries such as node-gyp and so on.


jsoncode
4k 声望786 粉丝

I'm jsoncode