node gyp is because the node program needs to call some tools written in other languages, and it needs to be compiled first, otherwise there will be cross-platform problems; node-gyp is included in newer Node versions. , used to compile native C modules.
The operating environment of this article: Windows 7 system, node11.15.0 version, Dell G3 computer.
What does node gyp do?
node-gyp, because the node program needs to call some tools written in other languages, it needs to be compiled first, otherwise there will be cross-platform problems. node-gyp is built-in (platform dependent) in newer Node versions and is used to compile native C modules.
Install node-gyp
1.node upgrade to 11 (greater than or equal to 11)
sudo n 11
2. Use npm command to install
sudo npm install -g node-gyp
3. Check whether the installation is successful
sudo node-gyp list
The print result is as follows, which proves that the installation is successful
gyp info it worked if it ends with ok gyp info using node-gyp@8.2.0 gyp info using node@11.15.0 | darwin | x64 10.24.1 14.17.5 gyp info ok
Recommended study: "nodejs video tutorial"
The above is the detailed content of What does node gyp do?. For more information, please follow other related articles on the PHP Chinese website!