I get an error running "node -v" in visual studio code - javascript

I'm brand new to coding and this is stumping me for some reason. The error that comes up when I type node -v in my visual studio code terminal is 'node : The term 'node' is not recognized as the name of a cmdlet... It works just fine when I run it in command prompt on my computer. I've read everywhere that you have to add it to your path which I'm not sure I did correctly now. I attached some pictures of what the path looks like for the user and system variable. I am hoping someone could give some feedback if this looks right or not. Thanks :)
user variable
system variable

I had this issue when I first got Node. The solution is to restart VSCode, opening new terminal sessions inside VSCode won't help for some reason. You will, of course, have had to add it to PATH which you said you have.
It wouldn't work in command prompt if you haven't added it to PATH so I think your configuration is correct. However, some of your variables are in Appdata/Roaming. I think it's supposed to be in ProgramFiles or ProgramFiles x86, but you can check this by going to the filepath you've put into your environment variables using file explorer, and checking if there's a node.exe or npm.exe file there.

Related

Cant start angular project

I was having some problems with an angular project so i reinstalled nodejs and angular cli however now when i try to run
ng serve
i get this error:
enter image description here
now ive done the typical google searching for this problem and it led me to stackoverflow with making sure the nodejs is in the enviroment variables path and it was already there:
enter image description here
also i checked the path to verify it and here is the folder:
enter image description here
i tried to be as thorough as possible before coming here to ask this question. i dont know how to fix this when the path is correct. please help!!
Try checking your node version to see if you have node properly
installed.
Maybe your CMD was opened before the path was set, try
opening a new CMD window and execute the same command again.

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.

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

Terminal IDE: How to get a javascript to run?

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

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