Error when running javascript


#1

I receive this error when running javascript in Atom:

‘C:\Users\Justin’ is not recognized as an internal or external command, operable program or batch file.

[Finished in 0.049s]

test.js file that contains: console.log(“Hello”)

I pressed Shift+Ctrl+B

I also downloaded and installed node.js from https://nodejs.org/en/ and still get the same error.


#2

Hello.

I bet the full path of the file has a space in there.

C:\Users\Justin Bieber\Documents\test.js will already have a problem after Justin. Best to create a new directory for you code files and keep it simple. Example C:\codeFiles\JS\ as base.

Does this suggestion help you?
BR


#3

Keep in mind that Atom has no ability to run code, so you need to identify the package you’re using if you want package-specific help. In this case, the package you’re using does not put quotes around the command string when it sends the script out to the Windows shell, so Windows correctly sends back an error.