artoale / atom-tern

Tern plugin for atom editor
MIT License
37 stars 3 forks source link

Uncaught TypeError: Cannot call method 'completions' of null #2

Open alicoding opened 10 years ago

alicoding commented 10 years ago
Error: Cannot find module '/Users/alialdallal/.atom/packages/Tern/node_modules/.bin/tern'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:279:25)
    at Function.Module.runMain (module.js:496:10)
    at startup (node.js:129:16)
    at node.js:1037:3
 server.coffee:9
tern exited with code: 1 server.coffee:18
Uncaught TypeError: Cannot call method 'completions' of null 
Uncaught TypeError: Cannot call method 'completions' of null 
artoale commented 10 years ago

That's weird.... Can you check if the mentioned file is there or not? It'supposed to be installed with npm when you install the plugin.... Seems like a strange atom behavior...

alicoding commented 10 years ago

Is there, but link to something empty.

lrwxr-xr-x  1 alialdallal  staff   137B 15 Mar 07:42 tern -> /private/var/folders/jb/7cch4h6x2c77vxn_cntxn44w0000gn/T/apm-install-dir-114215-71794-hd0fm9/node_modules/Tern/node_modules/tern/bin/tern
╭─alialdallal@Alis-MacBook-Pro  ~/.atom/packages/Tern/node_modules/.bin  
╰─$ tern
zsh: command not found: tern
artoale commented 10 years ago

That's super-weird... Can you run apm update within the Tern folder and see if things get better? On Mar 15, 2014 12:44 PM, "Ali Al Dallal" notifications@github.com wrote:

Is there, but link to something empty.

lrwxr-xr-x 1 alialdallal staff 137B 15 Mar 07:42 tern -> /private/var/folders/jb/7cch4h6x2c77vxn_cntxn44w0000gn/T/apm-install-dir-114215-71794-hd0fm9/node_modules/Tern/node_modules/tern/bin/tern ╭─alialdallal@Alis-MacBook-Pro ~/.atom/packages/Tern/node_modules/.bin ╰─$ tern zsh: command not found: tern

— Reply to this email directly or view it on GitHubhttps://github.com/artoale/atom-tern/issues/2#issuecomment-37723779 .

alicoding commented 10 years ago

I did and still doesn't work.

╭─alialdallal@Alis-MacBook-Pro  ~/.atom/packages/Tern  
╰─$ ./node_modules/.bin/tern
zsh: no such file or directory: ./node_modules/.bin/tern

The werid thing is that it links to something that doesn't even exist.

alicoding commented 10 years ago

Ok now it's working for me, but here is what I did.

I first remove tern folder from node_modules (I have to remove it manually). Then I ran npm install tern. Restart Atom and run tern server from the that cmd+shift+P.

alicoding commented 10 years ago

And now it's linked to the right package.

╭─alialdallal@Alis-MacBook-Pro  ~/.atom/packages/Tern/node_modules/.bin  
╰─$ ll
total 8
lrwxr-xr-x  1 alialdallal  staff    16B 15 Mar 07:58 tern -> ../tern/bin/tern
artoale commented 10 years ago

Thanks you very much... I'll dive into that next week and see if I can reproduce it! On Mar 15, 2014 1:01 PM, "Ali Al Dallal" notifications@github.com wrote:

And now it's linked to the right package.

╭─alialdallal@Alis-MacBook-Pro ~/.atom/packages/Tern/node_modules/.bin ╰─$ ll total 8 lrwxr-xr-x 1 alialdallal staff 16B 15 Mar 07:58 tern -> ../tern/bin/tern

— Reply to this email directly or view it on GitHubhttps://github.com/artoale/atom-tern/issues/2#issuecomment-37724038 .

orenmizr commented 10 years ago

@artoale Can you please explain how to fix this issue on a windows build? i removed the package manually and npm installed it. didn't help

Uncaught TypeError: Cannot call method 'completions' of null c:\Users\oron.atom\packages\Tern\lib\tern.coffee:20