admin管理员组

文章数量:1023848

Is it possible to run a JavaScript file with node.js on windows? I have been trying to for hours and can't find any more solutions on the internet that work.

I have a js-file that uses scribbletune which only works with node.js. I have node.js installed and I installed gitbash because it was remended in a forum. I tried to run from mand prompt and gitbash but nothing seems to happen. What am I doing wrong? Any help would be very much appreciated.

Is it possible to run a JavaScript file with node.js on windows? I have been trying to for hours and can't find any more solutions on the internet that work.

I have a js-file that uses scribbletune which only works with node.js. I have node.js installed and I installed gitbash because it was remended in a forum. I tried to run from mand prompt and gitbash but nothing seems to happen. What am I doing wrong? Any help would be very much appreciated.

Share Improve this question edited Aug 25, 2017 at 9:15 Clíodhna 8181 gold badge15 silver badges30 bronze badges asked Aug 25, 2017 at 8:48 bloodbasserbloodbasser 131 gold badge1 silver badge3 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

There is no need to install gitbash to use Node on Windows. It's a handy thing to have if you're used to a *nix environment. If you're not, it just gives you something more to learn, which isn't helpful if you're already in the middle of trying to learn Node.

Just:

  1. Get the Windows installer from https://nodejs/en/download/

  2. Run the Windows installer

  3. Create a directory for your project

  4. Open a Command Prompt Window to get a mand line

  5. Switch to your project directory

  6. (Optional, but a good idea) Use npm init to create a package.json file (it'll walk you through it)

  7. Install any libs you're going to be using via npm (for instance, npm install scribbletune from your mand prompt window)

  8. Put your JavaScript files in that directory

  9. Use node main.js at the mand line to run your main file (whatever it's called; main.js is just a placeholder)

Inorder to run a js (java script file) file

step 1. u need to go to the file location where u want to run.

step 2. just use "shift +right click". u will see a pop-up and go to powershell or cmd.

step 3. type "node FILENAME.js"

final step: you will see the result ^.^

Is it possible to run a JavaScript file with node.js on windows? I have been trying to for hours and can't find any more solutions on the internet that work.

I have a js-file that uses scribbletune which only works with node.js. I have node.js installed and I installed gitbash because it was remended in a forum. I tried to run from mand prompt and gitbash but nothing seems to happen. What am I doing wrong? Any help would be very much appreciated.

Is it possible to run a JavaScript file with node.js on windows? I have been trying to for hours and can't find any more solutions on the internet that work.

I have a js-file that uses scribbletune which only works with node.js. I have node.js installed and I installed gitbash because it was remended in a forum. I tried to run from mand prompt and gitbash but nothing seems to happen. What am I doing wrong? Any help would be very much appreciated.

Share Improve this question edited Aug 25, 2017 at 9:15 Clíodhna 8181 gold badge15 silver badges30 bronze badges asked Aug 25, 2017 at 8:48 bloodbasserbloodbasser 131 gold badge1 silver badge3 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

There is no need to install gitbash to use Node on Windows. It's a handy thing to have if you're used to a *nix environment. If you're not, it just gives you something more to learn, which isn't helpful if you're already in the middle of trying to learn Node.

Just:

  1. Get the Windows installer from https://nodejs/en/download/

  2. Run the Windows installer

  3. Create a directory for your project

  4. Open a Command Prompt Window to get a mand line

  5. Switch to your project directory

  6. (Optional, but a good idea) Use npm init to create a package.json file (it'll walk you through it)

  7. Install any libs you're going to be using via npm (for instance, npm install scribbletune from your mand prompt window)

  8. Put your JavaScript files in that directory

  9. Use node main.js at the mand line to run your main file (whatever it's called; main.js is just a placeholder)

Inorder to run a js (java script file) file

step 1. u need to go to the file location where u want to run.

step 2. just use "shift +right click". u will see a pop-up and go to powershell or cmd.

step 3. type "node FILENAME.js"

final step: you will see the result ^.^

本文标签: How to Run JavaScript file with nodejs on windows (scribbletune)Stack Overflow