07-21-2023, 02:23 PM
**For macOS users**
If you need to use `node-gyp` from within `npm` (e.g. through `npm install`), you will have to install node-gyp (either globally with `-g` or to a predictable location) and tell `npm` where the new version is.
In my case, turns out my project defaulted to using `node-gyp v3.8.0` to building my project's modules.
To remedy that, I ran the following commands:
```
npm config set node_gyp /usr/local/lib/node_modules/node-gyp
npm install
```
I hope this is insightful for anyone going through the same.
If you need to use `node-gyp` from within `npm` (e.g. through `npm install`), you will have to install node-gyp (either globally with `-g` or to a predictable location) and tell `npm` where the new version is.
In my case, turns out my project defaulted to using `node-gyp v3.8.0` to building my project's modules.
To remedy that, I ran the following commands:
```
npm config set node_gyp /usr/local/lib/node_modules/node-gyp
npm install
```
I hope this is insightful for anyone going through the same.