Closed cswl closed 6 years ago
because npx bundles npm, it can actually predict exactly where the npm binary is going to be, which is what that NPM_PATH
is. It gets a little weird with the embedded version in npm, which goes kind of the opposite direction: npm bundles npx in that case, and there it has its own special bin file which is similar to npx/bin/index.js
, but specific to the way libnpx is used in that project.
I see thanks for the information. Closing this now.
I'm trying to use
libnpx
for mynrs
project. Which parses package.json and calls scripts as if withnpx -c
makingnpm run
a few characters shorter..And I see the
npx
cli's code here.. https://github.com/zkat/npx/blob/752db4847f42346e784a029a5e012145239d1496/bin/index.js#L6From there it seems,
npm
is an depedency ofnpx
itself.However I couldnt find
npx
installed globally. it seems like it's bundled withnpm
itself..bin/npx -> ../lib/node_modules/npm/bin/npx-cli.js
So how does it find it under
node_modules
?