Node gyp error solution: 1. Open cmd administrator mode; 2. Execute "npm install --global --production windows-build-tools"; 3. Install node-gyp; 4. Configuration Just rely on it.
The operating environment of this article: Windows 7 system, nodejs version 10.16.2, Dell G3 computer.
How to solve node gyp error reporting problem?
Solution to node-gyp error problem:
1. npm install windows-build-tools
Open cmd administrator mode and execute the following command:
npm install --global --production windows-build-tools
Wait for the execution to complete and restart CMD
2. Install node-gyp under windows
node-gyp is the compilation tool used when compiling c extensions for node.
Installation method:
npm install -g node-gyp
3. Configuration dependencies
## npm config set python python2.7
## npm config set msvs_version 2015If nothing else happens, we can use node-gyp to build.
If there is a problem, you can refer to the github homepage of node-gyp.
4. If Python3 is already installed on your computer and there is a conflict between the two versions, you need to change the file name:
%USERPROFILE%\.windows-build-tools\python27
Change to Python2.exe and PythonW2.exe
Recommended learning: "
node.js video tutorialThe above is the detailed content of How to solve node gyp error reporting problem. For more information, please follow other related articles on the PHP Chinese website!