Cannot run a simple Hello World program using nodejs [closed] - node.js

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed last year.
Improve this question
After downloading Node.js and Visual Studio Code and after setting up the folders and changing it into respective directories using command lines inside the integrated powershell of VS Code, the 'node app.js' command fails to run the Hello World program. I wrote 'node' along with the full name of the directory and the filename app.js, still its unable to run it.
I have attached the screenshot of it.

You forgot to save your file, In VSCode - a white dot next to the file indicates unsaved changes to the file.
Save your file Ctrl+S and fire off node app.js like that :

Looks like you haven't saved your file. Save it and try to execute it again.

Related

Getting SyntaxError: JSON5: invalid character '\"' at 3:5 (REACT Project) [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
Picture of file with error code
Here is a link to a picture of the file with the error code message above ^^.
I get this error whenever I try to run "npm run dev"
I'm not sure if this picture shows enough detail, so, tell me if there is more detail I should include because I have no clue.
Is there something in this file I should manually edit or are there any commands I should type to fix this issue?
I tried reinstalling nodejs many times and creating a new project. Can someone actually give me a suggestion on what might be causing this issue?
Please add more detail like which rpm version you are using it. It seems some package version mismatching issue.

Installed Go, but command go not found. Does work on one terminal linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I installed go on linux yesterday. It worked fine and downloaded some tools and they worked also. I left the terminal open and when I came back today go stopped working... In the left terminal go works and does everything... But when I open another terminal and type go it said "command go not found" (see screenshot).
Can anyone help me please? I don't know what I did wrong or what went wrong...
Go works on the left terminal, not right...
tl;dr
Add the export command you ran to the $HOME/.bashrc file (preferably at the end).
When you installed go you probably ran the export command to add the location of go binaries to the PATH variable. But here's the thing. The PATH variable is, effectively, reset to the previous value when you open the new terminal. To make it permanent you need to add the command to your shell's rc file.
What's an rc file?
When you open the terminal it uses a rc (short for run commands) file and runs the commands in this file. The name of the file depends on the shell you are using.
If you are using bash, the name would be .bashrc. If you are using zsh, the name would be .zshrc.
You can run echo $PATH in both the terminals and see the PATH variable in which go runs would have the location of go binaries and the other wouldn't.
So to make this permanent, add the export PATH=$PATH:{PATH_GO_BINARIES} to the rc file. And, then, whenever a new terminal is opened, the PATH variable would be updated to contain the location of go binaries.

whenever I use "sudo su", i'm getting "bash: export : = not a valid identifier". I'm new to linux. Please excuse for not being more informative [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I'm using UBUNTU 20.04,wayland. However I'm getting root privileges after that two messages.
The root .bashrc file has a line that looks like this:
export PATH = /snap/bin:/usr/local/sbin/...
Get rid of the spaces around the =.
export PATH=/snap/bin:/usr/local/sbin/...

:wq! results in E212: Can't open file for writing Press ENTER or type command to continue [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I am just trying to exit my vim file with :wq! but it gives me the error:
E212: Can't open file for writing
Press ENTER or type command to continue
I press enter or type anything and it goes back to editing the file. Is there something wrong?
I am now stuck in my text editor.
You can get more details about the error via :help E212:
For some reason the file you are writing to cannot be created or overwritten.
The reason could be that you do not have permission to write in the directory
or the file name is not valid.
If you don't need the changes any longer, just :q! and be done with it. For multiple Vim arguments, there's also :qall!.
If you do want to keep the changes, one approach is to investigate the permissions issue, e.g. in another terminal or via the file explorer, and fix the issue (e.g. via chmod / chown).
Alternatively, you can persist the changes elsewhere via :w /tmp/changes, then :quit Vim, and then resolve the problem outside of Vim.
To address the "I'm stuck in Vim" (assuming it's not possible / tedious to start another session on the system): :suspend puts Vim in the background, and drops you into the original shell you started Vim from. :shell starts a new shell from inside Vim, to which you return via exit.

'usr/bin' is not included in the path environment [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Whenever I start a new terminal and try to run a command, I get this error.
I have found out that it can be solved with export PATH=/usr/bin:/bin, but it has to be done for each terminal I open. In the etc/environment file, the path is correct, so hence I do not understand what is wrong.(But this error appeared after I added some lines to bashrc and paths to have some shortcuts for ruby, rails , git ; ( was following a course on Coursera )).
How can this be fixed?
What's happened here is you've clobbered your PATH variable. Your PATH is pretty important, whenever you enter a command your shell (usually bash), will check each of the directories specified in your PATH for a program of the same name.
Each directory specified in your path is separated by a colon :, and a minimal PATH variable usually looks something like /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.
When you have the line export PATH=/usr/bin/git at the end of your .bashrc you are telling your shell that you only want to search /usr/bin/git for commands.
Instead, the line export PATH="$PATH:/usr/bin/git" will tell your shell to search all of the directories previously specified in your shell, and then search /usr/bin/git.
Another thing to note is that your shell will search the directories in your PATH in the order they're specified, and use the first matching command found, so the order that directories are specified in the PATH can matter too.

Resources