Wednesday, 7 June 2017

Cannot run nodejs script in command prompt

When I try to run a node.js program in windows command prompt by stating its location, it will invariably say "[stated location] is not recognized as an internal or external command, operable program or batch file."

In all answers to similar questions, in all node.js manuals, it is assumed you can just run a node.js file by calling it from its location. There will always be the suggestion of trying some "hello world" example BEFORE establishing a server and so on.

Even if I clean the command prompt with "prompt $ cmd", and then write the whole location manually, I get the same message.

When I run "echo %path%" I get "C:\Program Files\nodejs\bin"

When I run "node -v" I get "v6.10.3"

When I run "node a00.js" (where "a00.js" is the script's name), it believes the whole path is a module, so it says it cannot recognize that module.

If I clear the command prompt with "prompt $ cmd" and then run "node a00.js", it believes "a00.js" to be a module, so it says it cannot recognize that module.

Help please! Thanks in advance.



via Algunillo

No comments:

Post a Comment