Terminal IDE: How to get a javascript to run? - javascript

I've been playing around with Terminal IDE (I've recently discovered it) and I wish to run a javascript code I've written but when I issue to command to run according to Spartacus Rex's instructions, I always get a 'Permission Denied' message. His command to run a script is: ./script_name.js
Spartacus gives examples in his help document with regards to running scripts he has written that come with this app of his (these scripts have a .sh extension). When running them according to the ./script_name.sh command, all works fine.
Again, this is not working for me as I try to run my own scripts from the Terminal IDE command line. Can someone please point me in the right direction? I am a novice at all this programming, but I can figure out a lot on my own if pointed in the right direction at least. Thanks for any help anyone can provide.

Those are not JavaScript Files you've been running with ./scriptName.sh , actually those are bash shell scripts, Google for it to know what these files actually are. When you create a custom shell script, do not forget to add execution permission to it : chmod +x your_custom_script.sh. I don't think you can actually run JavaScript files inside Terminal IDE
Not sure about links browser provided with it though

Related

Error in terminal when trying to run code in VSCode

I'm relatively new to using IDEs and recently started using VSCode for class. I'm using the Code Runner extension and working on a Mac. Whenever I go to run a piece of code I receive the following message in my terminal:
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
Could someone help explain what exactly this message means? I think for class we want to use the Bash shell so I'm hesitant to make any changes to the current settings but I don't want it to interfere with my ability to run/test code.

How to fix "error : file not found: (file name) Usage: javac <options> <source files>" on Linux?

Good evening, all. I am currently completing an assignment for my introductory compsci course and I'm trying to run a basic HelloWorld program. However, when typing "javac HelloWorld.java", the message "error: file not found: HelloWorld.java
Usage: javac
use --help for a list of possible options"
keeps popping up. I've scoured the internet and have no idea how to fix this issue using my Linux terminal inside visual studio code. I've saved the file, have opened and reopened it countless times but to no avail. Please, I beg, help me if you have any idea for me to fix this issue.
#Brandon, Just a note, the mentioned error (by you) occurs only if there is no expected file to compile in the specified location.
If HelloWorld is highlighted in light blue on issuing ls -lha means it may be a directory and might not be a file. Can you please double check it as mentioned below?
Are you able to navigate into the HelloWorld directory by using the following command: cd HelloWorld? If it is, please check what are the files available inside the directory by issuing ls -lha. Then it might help to proceed further.

Project type for executing JavaScript in IntelliJ IDEA

Is there any IntelliJ IDEA project type that allows me to execute JavaScript, showing the results in the console?
I've been trying HTML5_Boilerplate, but it requires to generate the HTML with the embedded script, for instance.
Thank you.
UPDATE: IDEA can actually do it by taking advantage of Node, no need for an external browser, as long as IDEA's console can do the trick:
How can I set this up from scratch?
IDEA itself can't execute Javascript, it can only be executed by browsers/Node.js interpreter. Project type doesn't matter. If you like to be able to run .js files with Node.js via Run command in right-click menu, you need to make sure that NodeJS plugin is installed and enabled. You can install it via Settings | Plugins, Install JetBrains plugin...

Unable to Run JavaScript in Atom with Script package

I am trying to run JavaScript code in Atom with Script package. It can run Python successfully, but with JS files it gives the following error message:
The system cannot find the file specified.
I had the same problem while analyzing some JavaScript code of an extension for Chrome.
Using: Windows 7 64Bit Atom:1.24.0 x64
Since I my coding Folder is somewhere else I copied the files in that folder. Let’s say:
C:\Users\USER\CodingStuff\
then it started working. I have also tried adding the extension file the Sources via:
1 - CTRL+SHIFT+I
2- Right click -> add folder to workspace
But that did not work.
Side note: node.js has to be installed on the system.
Hope it helps.
I know I am late, but if any other faces the same issue, my answer will be helpful.
Assumed that you want to run your javascript outside browser and you installed node.js.
There is a bug in "script" package of Atom. Check ur path of the script if there are spaces then this leads to the aforementioned error. Work around is remove spaces.
for ex:
E:\Java script\trial.js
change to:
E:\Javascript\trial.js

Is there a way to run JavaScript code inside Aptana Studio 3 IDE?

I created a Test.js file and wrote two lines of JS code in it:
var a = 5;
console.log("The result is = " + a);
The output should be:
"The result is = 5"
Is there a way I can see this in Aptana Scripting console, instead of integrating the JS code in a HTML file and saving/refreshing it?
Can any other IDE, say Netbeans help, if not Aptana?
Any advise would be highly appreciated.
Regards
Roy
I think that it would be best if you give Node.js a try. This way, you get to call node test.js on a console window and see the result.
I'm pretty sure that console is meant for viewing the output of Aptana's Ruby-based commands (installed under the Commands menu). It might be possible to follow the instructions here: http://www.chromium.org/for-testers/enable-logging and then tail the resulting log file in a Terminal panel (not the same as a console window).
I'm afraid it is not possible.
But What I did was to setup a simple workbench.html file, where in the header I put
[...]
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="js/myJsFile.js"></script>
and then modified the myJsFile.js and saved it.
Another very intersting possibility is given by http://www.developer.nokia.com/Community/Wiki/Aptana_WRT_Plugin:_Displaying_log_messages_in_Output_console
just check it
It's not exactly what you asked, but it might point you in the right direction. There's a project called EclipseMonkey ... I'm not sure the status. Here's a working (?) example. Your mileage will vary. http://blogs.edgehill.ac.uk/webservices/2008/10/16/aptana-outline-auto-expansion-monkeyed/
What you can do is you can download node.js from node.js, download the package and follow the installation instructions on the screen.
If using a Windows, the node.js package comes with its own interactive command prompt which you can open. To run a js file on windows, open the windows command prompt, type in node, then the name of your file e.g. test.js. Node.js should run your file.
If using a Mac, the node.js package runs through the terminal application on the mac. To run a file, type in node, then the name of your file e.g. test.js, node.js should run the file.
Aptana Studio 3 has the ability to open the terminal inside the IDE itself. Save your file in Aptana Studio and follow the instructions to run a file on the mac.
By the way, keep your files labelled in lowercase letters, I tried using Uppercase for the first letter and it did not work.
Hope that helps.

Categories

Resources