-
-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propose that n auto
skip over empty files or package.json
with no engines
property
#692
Comments
In practice, is it a I was not entirely happy with going for |
If there is no
For interest you can check what version is found with |
Exactly right. When running auto in a directory where I expected auto to error out (since I hadn't configured any preference), I found it switched to current instead. Debugging my situation a little showed it was the existence of the |
Something like this would make sense. It wouldn't really make sense for there to exist an empty |
Though it should keep searching (as in monorepos). Ideally it would search the current directory for a valid preference. If none is found, it would search the parent directory and so on. |
Released in v8.0.0 |
Problem
n auto
in a directory with an empty.n-node-version
,.node-version
, or.nvmrc
, or apackage.json
with noengines
will default tocurrent
, overriding any system default.Short Version
I would expect that the presence of a file lacking configuration in it (empty
.
file, orpackage.json
without the respective config) would be treated the same as not having that file in the first place (continue search or error out, as applicable).Long Version
n auto
's behavior was a little unexpected for me—I expected an error message likeError: no auto version found (.n-node-version, .node-version, .nvmrc, or engine in package.json)
if no preferred version setting is found, not invisibly selecting the current version. I prefer to stay onlts
, but this behavior makes it hard to use auto as I don't want to necessarily check whether a repo is configured with a preferred version.The lack of a configuration should not be treated as configuration to use current. That's weird.
Configuration Details
$ n --version 7.3.1 $ command -v node /usr/local/bin/node $ node -p process.platform darwin
The text was updated successfully, but these errors were encountered: