ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

tern_for_sublime failed to install Tern on Windows 7 #40

Closed hezjing closed 10 years ago

hezjing commented 10 years ago

Hi

Sublime Text 3 (on Windows 7) keeps complaining that Tern has not been installed even though I have selected the option to install it automatically by tern_for_sublime.

There are some errors shown in the Sublime Text console:

DPI scale: 1.25 startup, version: 3059 windows x64 channel: stable executable: /C/Program Files/Sublime Text 3/sublime_text.exe working dir: /C/Program Files/Sublime Text 3 packages path: /C/Users/hezjing/AppData/Roaming/Sublime Text 3/Packages state path: /C/Users/hezjing/AppData/Roaming/Sublime Text 3/Local hardware concurrency: 4 zip path: /C/Program Files/Sublime Text 3/Packages zip path: /C/Users/hezjing/AppData/Roaming/Sublime Text 3/Installed Packages found 4 files for base name Default.sublime-keymap found 1 files for base name Default.sublime-mousemap found 2 files for base name Main.sublime-menu loading bindings loading pointer bindings found 1 files for base name Default.sublime-theme theme loaded app ready wrote startup cache, added files: 3 orphaned files: 0 total files: 151 cache hits: 148 pre session restore time: 0.149348 using gamma: 1.9 (err: 81.5966) startup time: 0.189348 first paint time: 0.192348 launching: /C/Program Files/Sublime Text 3/plugin_host.exe reloading plugin Default.block reloading plugin Default.comment reloading plugin Default.copy_path reloading plugin Default.delete_word reloading plugin Default.detect_indentation reloading plugin Default.duplicate_line reloading plugin Default.echo reloading plugin Default.exec reloading plugin Default.fold reloading plugin Default.font reloading plugin Default.goto_line reloading plugin Default.history_list reloading plugin Default.indentation reloading plugin Default.kill_ring reloading plugin Default.mark reloading plugin Default.new_templates reloading plugin Default.open_file_settings reloading plugin Default.open_in_browser reloading plugin Default.pane reloading plugin Default.paragraph reloading plugin Default.paste_from_history reloading plugin Default.save_on_focus_lost reloading plugin Default.scroll reloading plugin Default.set_unsaved_view_name reloading plugin Default.side_bar reloading plugin Default.sort reloading plugin Default.swap_line reloading plugin Default.switch_file reloading plugin Default.symbol reloading plugin Default.transform reloading plugin Default.transpose reloading plugin Default.trim_trailing_white_space reloading plugin CSS.css_completions reloading plugin Diff.diff reloading plugin HTML.encode_html_entities reloading plugin HTML.html_completions reloading plugin Package Control.Package Control loaded 837 snippets reloading plugin tern_for_sublime.tern plugins loaded Traceback (most recent call last): File "X/subprocess.py", line 1090, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 157, in on_api_ready m.plugin_loaded() File "C:\Users\hezjing\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\tern.py", line 495, in plugin_loaded subprocess.check_output(["npm", "install"], cwd=plugin_dir) File "X/subprocess.py", line 571, in check_output File "X/subprocess.py", line 818, in init File "X/subprocess.py", line 1096, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified Package Control: Skipping automatic upgrade, last run at 2014-04-09 03:26:35, next run at 2014-04-09 04:26:35 or after

Do you have any idea of what is wrong here?

marijnh commented 10 years ago

Probably the install failed. Try it manually by going to C:\Users\hezjing\AppData\Roaming\Sublime Text 3\Packages\tern_for_sublime\ and running npm install

hezjing commented 10 years ago

Thanks, that resolve the problem.

colthreepv commented 10 years ago

yes, this solves the issue, but is just a fixup, would be more useful if the plugin worked flawlessly in both environments (*nix, windows), as sublime does.

My knowledge of python is really minimal, but from that i remember that any subprocess call in windows likes shell=True, that should also fix the path (because The system cannot find the file specified is a windows PATH issue)

I've tried doing that by myself, but then it fails at line 501 saying that e.output is a byte and not a string (weird)

Anyone can help fixing this and providing a pull request?