angelozerr / tern-node-express

A Tern plugin adding support for express web application framework for node.
http://expressjs.com/
MIT License
56 stars 4 forks source link

Dosen't works #16

Closed agauniyal closed 8 years ago

agauniyal commented 8 years ago
{
  "ecmaVersion": 5,
  "plugins": {
    "node": {},
    "modules": {},
    "node-express": {}
  }
}

I'm using tern_for_sublime and tern is working perfectly but fails to provide suggestions for express specific code.

angelozerr commented 8 years ago

Have you a stack trace error? WHich version of ternjs do you use? If you are using 0.17.0, try to remove tern folder from the tern-node-express/node_modules/tern

agauniyal commented 8 years ago

Stack trace error from where? As far as I know it isn't producing any errors in sublime text's console or somewhere else I could notice. I have installed it both ways, globally as well as in project. which way should I check?

dhensche commented 8 years ago

@agauniyal I had the same error and noticed the tern_for_sublime package uses 0.17.0. Removing the tern folder, like @angelozerr suggests gives me express completions

angelozerr commented 8 years ago

Thanks @dhensche for your answer. I have published 0.4.0 which is based on tern 0.17.0, It should work now without removing tern folder. I close this issue.

agauniyal commented 8 years ago

@dhensche do you mind sharing your steps to configure tern-node-express with sublime. Mine are:

  1. express -e myapp
  2. cd myapp/
  3. npm install
  4. npm install tern tern-node-express
  5. .tern-project with
{
  "ecmaVersion": 5,
  "plugins": {
    "node": {},
    "node-express": {}
  }
}

Now open sublime, still dosen't works :/

dhensche commented 8 years ago

@agauniyal you need to go into your tern_for_sublime installation directory (/Users/dhensche/Library/Application Support/Sublime Text 3/Packages/tern_for_sublime) for me and run the npm install tern-node-express there. The tern_for_sublime package starts up its own tern server and according to http://ternjs.net/doc/manual.html#plugin_third_party, this is one of the ways to install third party plugins

agauniyal commented 8 years ago

@dhensche this was it. Many thanks for your help :blush: