Don’t find node_modules up the directory tree when installing #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
elm-tooling install
creates links innode_modules/.bin/
.Currently, it looks up the directory tree (starting from the directory containing
elm-tooling.json
) and errors out if nonode_modules
is found.This is “unsound”. Consider this directory structure:
What should
project/node_modules/.bin/elm
link to?appA
’s Elm version orappB
’s Elm version?Besides,
elm-tooling.json
only affects the current project. Soelm-tooling install
shouldn’t touch stuff outside the project.This PR fixes the
node_modules
locator. Now,elm-tooling install
does the only correct thing – installs intonode_modules
in the same directory aselm-tooling.json
. Ifnode_modules
doesn’t exist it is created.Note: This has an interesting secondary effect. Yarn 2 does not create a local
node_modules
folder. So if you installelm-tooling
using Yarn 2, you’ll now get a localnode_modules
folder. It will only contain a.bin/
folder with links to your tools. This should be fine, and even wanted. Editors supportnode_modules/.bin/
out of the box. In other words, it should now be possible to useelm-tooling
with Yarn 2 without getting errors.