Skip to content
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

Incompatible with NVM #330

Open
zzph opened this issue Jun 5, 2023 · 2 comments
Open

Incompatible with NVM #330

zzph opened this issue Jun 5, 2023 · 2 comments

Comments

@zzph
Copy link

zzph commented Jun 5, 2023

Hi,

Just writing this as a service for others who get in this headache.

nvm does not play nicely with eslint/sublime. I spent weeks on/off trying to configure paths etc to get this working. It just doesn't.

My solution?

Remove nvm, instead use volta (seems better anyway). Then npm install -g eslint and voilia!

My config looks like this

{
    "linters": {
        "eslint": {
            "disable": false,
            "args": ["--env=es6"],
            "env": {
               "PATH": "/Users/[USER_NAME]/.volta/tools/image/node/18.16.0/bin"
            }
        }
    }
}

Maybe it's worth updating the README.MD to reflect this

@kaste
Copy link
Contributor

kaste commented Jun 6, 2023

Well that still needs manual config as it seems. What we would like to see is completely automatic discovery/zero config. (What if you use various node versions?)

@jgburet
Copy link

jgburet commented Feb 29, 2024

Hey, I have the same issue when using https://asdf-vm.com/
I tried with

    "linters": {
        "eslint": {
            "env": {
                "PATH": "~/.asdf/shims/node:$PATH"
            },
            "executable": "${folder}/node_modules/eslint/bin/eslint.js",
            "selector": "source.ts, source.js - meta.attribute-with-value",
            "working_dir": "${project_route:${folder:${file_path}}}"
        }
    }

without success.

I'm expecting the package to resolve the node version that is used within the project (hence why I tried setting working_dir with ${folder} thinking it would behave just like when calling node from my Terminal), or to the system's node (also manager by asdf (asdf global nodejs 21))

Solved:
"PATH": "~/.asdf/shims/node:$PATH" -> "PATH": "~/.asdf/shims/:$PATH"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants