Porting the Setup Check
In this lesson, you ported the team’s setup check to JavaScript as its first Node project, ran it, and then found two slips a fast port makes.
- Start the project folder with a
package.jsonholding{ "type": "module" }, so every.jsfile in it runs as a strict ES module. - Try each value at Node’s REPL before it goes in the file:
process.versions.node,process.platform, andprocess.cwd()need no imports. - An unexpected
undefinedin the output, with no error, means a property name on that line is misspelled. - When the script stops, read the error from the top: the file and line, the caret, the error’s
name and message, then the
atlines.
Here’s the project’s package.json:
{ "type": "module" }