elicwhite / SublimeJSCSFormatter

Sublime Text 3 Plugin to Autoformat with JSCS
MIT License
78 stars 9 forks source link

jscs and nodenv. #39

Open chyzwar opened 8 years ago

chyzwar commented 8 years ago

I am using nodenv. Below my config.

{

  "node_path": {
    "linux": "/home/raziel/.nodenv/shims/node",
  },

  "jscs_path": {
    "linux": "/home/raziel/.nodenv/shims/jscs",
  },

  "config_path": "",

  "format_on_save": false
}
$ which jscs
/home/raziel/.nodenv/shims/jscs
$ which jscs
/home/raziel/.nodenv/shims/jscs

When I try to format I get (in sublime console):

error: Error: /home/raziel/.nodenv/shims/jscs:3
[ -n "$NODENV_DEBUG" ] && set -x
     ^^^^^^^^^^^^^^^

SyntaxError: Unexpected string
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)
    at startup (node.js:141:18)
    at node.js:1003:3
chyzwar commented 8 years ago

I fixed this buy changing a path:

{

  "node_path": {
    "linux": "/home/raziel/.nodenv/shims/node",
  },

  "jscs_path": {
    "linux": "/home/raziel/.nodenv/versions/5.4.0/bin/jscs",
  },

  "config_path": "",

  "format_on_save": true
}

Problem still stays. It should be possible to use /home/raziel/.nodenv/shims folder.

elicwhite commented 8 years ago

What happens when you try to run /home/raziel/.nodenv/shims/jscs from the command line?

chyzwar commented 8 years ago

selection_0024