I want to run my Js code in my terminal but as I click on the terminal button to run it, I'm getting a pop-up message in the bottom left "Code is already running". But if I code in the terminal directly, it's working pretty well. I don't even know that is this the right way to run the node.Js code as I'm new to it. But I want to create a backend for my website.
I've seen so many tutorials and read plenty of documents to get the solutions but the story remained the same as I was unfamiliar with most of the terms that were explained in the tutorials and the documentation. I just want to know the right way to run node.开发者_运维技巧js code in my editor and the very initial steps to start creating a backend for my website. The image url
Lets say your node project runs from a javascript file named app.js
.
To run a node project you just type node app.js
into your terminal. Just replace the app.js with the name of your javascript file.
If it is already running and can't figure out how to kill it you could always restart your computer.
Simply close all powershells that appear on the right side. If you need run a node server, you have to go the app.js directory and type node app.js
in a new powershell. The problem occurred, because of your server is running in another powershell.
I highly recommend don't use unnecessary powershells.I usually use 2 powershells. one for run the server and another for install node packages.
精彩评论