atom-tern icon indicating copy to clipboard operation
atom-tern copied to clipboard

Uncaught TypeError: Cannot call method 'completions' of null

Open alicoding opened this issue 11 years ago • 8 comments

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 

alicoding avatar Mar 14 '14 17:03 alicoding

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...

artoale avatar Mar 15 '14 11:03 artoale

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

alicoding avatar Mar 15 '14 11:03 alicoding

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" [email protected] 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 .

artoale avatar Mar 15 '14 11:03 artoale

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 avatar Mar 15 '14 11:03 alicoding

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 avatar Mar 15 '14 12:03 alicoding

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

alicoding avatar Mar 15 '14 12:03 alicoding

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" [email protected] 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 .

artoale avatar Mar 15 '14 12:03 artoale

@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

orenmizr avatar Jun 24 '14 03:06 orenmizr