MicrosoftDocs/node-essentials

Incorrect command "node.index.js" in learning material

BjornGrylls opened this issue · 1 comments

Typos at unit 9 Exercise - Read and write to files at Work with files and directories in a Node.js app in learning material.

The Run the program section is wrong. Step 2 says to run the index.js file again, but the command is changed to node.index.js.
That should have been node index.js again as in step 1.

Trying to execute the incorrect commands gives the following error:
node.index.js : The term 'node.index.js' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1

  • node.index.js
  •   + CategoryInfo          : ObjectNotFound: (node.index.js:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

Also step 3 Select the index.js file makes no sense.

you are right, it's a typo

image

# default (CJS)
$ node ./index.js

# OR, `CJS`
$ node ./index.cjs

# OR, `ESM`
$ node ./index.mjs

https://learn.microsoft.com/en-us/training/modules/nodejs-files/9-exercise-read-write-files