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

File not found using Alt + j on linux, not working. #66

Open
luisantoniojr opened this issue Oct 1, 2013 · 3 comments
Open

File not found using Alt + j on linux, not working. #66

luisantoniojr opened this issue Oct 1, 2013 · 3 comments

Comments

@luisantoniojr
Copy link

When i try alt + j, this error appeared:

[Errno 2] Arquivo ou diretório não encontrado
[cmd: [u'jshint', u'/home/luis/Encfs/arquivos/projetos/nodejs/scriptErp/server.js', u'--reporter', u'/home/luis/.config/sublime-text-2/Packages/JSHint/reporter.js']]
[dir: /home/luis/Encfs/arquivos/projetos/nodejs/scriptErp]
[path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
[Finished]

i tried the command outside sublime, worked:
luis@linux-pc:~$ jshint /home/luis/Encfs/arquivos/projetos/nodejs/scriptErp/app/controllers/script.js --reporter /home/luis/.config/sublime-text-2/Packages/JSHint/reporter.js
[JSHint: /home/luis/Encfs/arquivos/projetos/nodejs/scriptErp/app/controllers/script.js]

26,2: Unnecessary semicolon.
37,14: Use '!==' to compare with ''.
81,10: Missing semicolon.
100,9: Missing semicolon.
102,6: Unnecessary semicolon.
106,2: Unnecessary semicolon.
127,2: Unnecessary semicolon.

✗ 7 errors, double-click above, [F4] for next, [shift-F4] for previous.

So, i found a bug in JSHint.py, not have entry for linux. So i put, i known maybe not the best way, but worked:

    if sublime.platform() == "windows":
        args['cmd'][0] += ".cmd"
    elif sublime.platform() == "osx":
        args['path'] = "/usr/local/share/npm/bin:/usr/local/bin:/opt/local/bin"
    elif sublime.platform() == "linux":
        args['path'] = "/home/luis/.nvm/v0.10.20/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:

teste

teste2

@stiofand
Copy link

I cant get this to work on Ubuntu 14:04, where is your path for linux supposed to point to???

@mstrutt
Copy link

mstrutt commented Oct 22, 2014

@stevematdavies for me on 14.04 I followed @luisantoniojr's suggestion and added these two lines:

elif sublime.platform() == "linux":
            args['path'] = "/home/mstrutt/local/bin"

I found the JSHint.py file by selecting Browse Packages from the Preferences menu

I found where node was installed by running npm config list (take /node off the end)

@RoverWire
Copy link

@mstrutt you are right, but I made a workaround, I just put this lines on .profile / .bashrc file:

// export nvm 
export NVM_DIR="/home/mstrutt/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
// add node path
export PATH="$PATH:$NVM_DIR/versions/node/$(nvm_version)/bin"

and it works!

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

No branches or pull requests

4 participants