With nodejs-10.15.0, when we run `yarn install` for a package at work, we see it unexpectedly install node-gyp: > [4/4] Building fresh packages... > > info This package requires node-gyp, which is not currently installed. Yarn will attempt to automatically install it. If this fails, you can run "yarn global add node-gyp" to manually install it. > > [1/4] Resolving packages... > > [2/4] Fetching packages... > > [3/4] Linking dependencies... > > [4/4] Building fresh packages... > > success Installed "node-gyp@3.8.0" with binaries: > > - node-gyp The ebuild installs both /usr/lib64/node_modules/npm/node_modules/node-gyp and /usr/lib64/node_modules/npm/node_modules/node-gyp directories. If I export PATH=/usr/lib64/node_modules/npm/bin/node-gyp-bin:$PATH then yarn sees /usr/lib64/node_modules/npm/bin/node-gyp-bin/node-gyp and uses it instead of installing it. We did not notice this issue with nodejs-8.14.0, though I see that it also installs similar /usr/lib64/node_modules/npm/node_modules/node-gyp and /usr/lib64/node_modules/npm/node_modules/node-gyp directories.
(In reply to Zac Medico from comment #0) > With nodejs-10.15.0, when we run `yarn install` Like sys-apps/yarn, or is that irrelevant in this context? > The ebuild installs both > /usr/lib64/node_modules/npm/node_modules/node-gyp > and > /usr/lib64/node_modules/npm/node_modules/node-gyp directories. I think you meant to point out two different directories.
(In reply to Jeroen Roovers from comment #1) > (In reply to Zac Medico from comment #0) > > With nodejs-10.15.0, when we run `yarn install` > > Like sys-apps/yarn, or is that irrelevant in this context? Yes, we're currently using sys-apps/yarn-1.13.0 with nodejs-10.15.0, and it works fine as long as we add /usr/lib64/node_modules/npm/bin/node-gyp-bin to PATH. We didn't have to make any PATH adjustment when we were using sys-apps/yarn-1.12.3 with nodejs-8.14.0. > > The ebuild installs both > > /usr/lib64/node_modules/npm/node_modules/node-gyp > > and > > /usr/lib64/node_modules/npm/node_modules/node-gyp directories. > > I think you meant to point out two different directories. Yes, the other directory is /usr/lib64/node_modules/npm/bin/node-gyp-bin, which contains a node-gyp binary that works perfectly well as long as we add the directory to PATH.
I think maybe this behavior could actually be intentional, based on what I've read here: https://github.com/nodejs/node-addon-examples/blob/master/1_hello_world/README.md#step-5 > Compile your addon: if you don't have node-gyp installed, use > sudo npm install node-gyp -g to install it. It comes bundled > with npm but is not normally linked as an executable in your > PATH so it's best to install it separately.