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

Problems with loading/using script #14

Closed johndoe1234 closed 8 years ago

johndoe1234 commented 8 years ago

I'm running newest ternjs: https://github.com/marijnh/tern/commit/c06155785601679e8ef52d647f608a63e9b17bfd

Express plugin is installed in tern directory using npm install (/tern/node_modules/tern-node-express).

When in .tern-project I add "node-express: to plugins and start tern I get this error:

module.js:340 throw err; ^ Error: Cannot find module 'tern/lib/infer' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at infer.registerFunction.arg (/home/johndoe/install/tern/node_modules/tern-node-express/node-express.js:3:16) at Object. (/home/johndoe/install/tern/node_modules/tern-node-express/node-express.js:7:3) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12)

If I modify paths in node-express.js to point to place where infer and tern are located /home/johndoe/install/tern/lib/infer instead of just tern/lib/infer tern does not report error. Unfortunately even though tern does not report a problem completion in this simple program does not work: http://expressjs.com/starter/hello-world.html

Tern does not provide any completion for app/res/req.

angelozerr commented 8 years ago

For using tern-node-express with last version you must use the code which is hosted in the github (and not use npm install) because of https://github.com/marijnh/tern/issues/641

I'm waiting for that tern is released to publish tern-node-express.

angelozerr commented 8 years ago

@johndoe1234 I have published node-express which uses now tern 0.16.0. Could you retry please?

johndoe1234 commented 8 years ago

Error does not appear any more.

angelozerr commented 8 years ago

Cool I close this issue.