Search code examples
node.jsnode-gyp

Should node-gyp be installed globally and locally?


I am looking at nodejs addon examples at https://github.com/nodejs/abi-stable-node-addon-examples.

The read-me section says that I must install node-gyp globally:

$ sudo npm install node-gyp -g

However, after installing node-gyp globally, does one also need to install it within the local project?

$ cd myproject
$ npm install node-gyp

Solution

  • It is good to install the node-gyp globally because main purpose of the node-gyp is to build the node native modules. node-gyp also need some tool like visual studio (in case of building on Windows) and python which also installed globally.

    after install globally no need to install it locally.