This problem has troubled almost all front-end developers, and I have a headache every time I change my computer. Just refresh the record.
- Install the specified version of python
Download address: https://www.python.org/downloads/windows/ - 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
- Configure python environment variables
Add in Path: C:/Python2.7 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.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。