Sublime Forum

How to show Javascritp terminal on Sublime

#1

Hello,
I have just installed Sublime to run Javascript.
I followed these post and set a JavaScript.sublime-build with the lines

{
   "cmd": ["node", "$file"],
   "selector": "source.js"
}

and this post with the lines

{
  "cmd": ["/usr/bin/node", "$file"], # the location of my installation of node
  "selector": "source.js"
}

I then selected Tools>Buil system> JavaScript. When I build a line the terminal appears at the bottom of the screen but it doesn’t show anything.

How can I display the output of the terminal on Sublime?

Thank you

0 Likes

#2

What are you running within the build system? Does it try to take user input, if so that won’t work.

0 Likes

#3

it is just a console.log("Hello, world");

0 Likes

#4

Does running /use/bin/node yourfile.js work in a terminal? Do you see any errors in the console (View > Show Console)?

0 Likes

#5
$ /usr/bin/node test.js 
Hello, world
$ node test.js 
Hello, world
0 Likes

#6

Please also answer the 2nd question I asked.

0 Likes

#7

Now looks like it is working fine:

Hello, world
[Finished in 149ms]

The console gives me this:

startup, version: 4169 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
application: /opt/sublime_text
working dir: /home/gigiux
packages path: /home/gigiux/.config/sublime-text/Packages
state path: /home/gigiux/.config/sublime-text/Local
zip path: /opt/sublime_text/Packages
zip path: /home/gigiux/.config/sublime-text/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.346099
startup time: 0.500805
first paint time: 0.549557
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
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.html_print
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.keymap
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
plugins loaded
Running /usr/bin/node /home/gigiux/Downloads/test.js

Thanks

0 Likes