You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.
I'm currently running into an issue, with a monorepo, in that I want npx to pick up the executable in the parent directory, instead of just looking at the current directory. I'm not sure if I'm missing something, but running npx eslint in the sub package folder of the monorepo cannot find eslint in the parent node_modules directory.
The node Module documentation, https://nodejs.org/api/modules.html, specifies the load order for modules, including parents. Executing require.resolve.paths('') should return the list of all available paths that are searched on a require.
Where
This should be how require operates currently today.
The text was updated successfully, but these errors were encountered:
Assuming you're like me and bumping into problems with Lerna hoisting into a root level .bin directory. I wonder if Lerna itself should be creating symlinks in the package/node_modules/.bin rather than assuming tooling will look upwards to find binaries
Aha, I found that Lerna was not symlinking eslint into my packageX/node_modules/.bin directories because it was not specified in "devDependencies". With the symlink in place, npx eslint now works as I expected, without trying to install eslint from the registry each time.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What / Why
I'm currently running into an issue, with a monorepo, in that I want
npx
to pick up the executable in the parent directory, instead of just looking at the current directory. I'm not sure if I'm missing something, but runningnpx eslint
in the sub package folder of the monorepo cannot findeslint
in the parentnode_modules
directory.The node Module documentation, https://nodejs.org/api/modules.html, specifies the load order for modules, including parents. Executing
require.resolve.paths('')
should return the list of all available paths that are searched on arequire
.Where
This should be how
require
operates currently today.The text was updated successfully, but these errors were encountered: