I'm new to Node.js and npm and I'm trying to configure a JavaScript development environment in Visual Studio 2017. I have downloaded and installed the latest recommended version of Node.js (currently v6.11.1).
From a command prompt I verified that my Node.js path is configured correctly and that I am pointing at the expected version. To do this I ran:
node -v
and as expected I got back:
v6.11.1
I also configured Visual Studio to use this version. To do that I went to Tools > Options, added the Node.js root folder to my list of External Web Tools, and moved the path to the top of the list as you see in the following screenshot.
I have verified that the Visual Studio tooling is in fact using this version by modifying my package.json file and verifying that the packages have downloaded. Here is a screenshot showing that:
I also launched the Node.js Interactive Window directly from my project node as is shown in the screenshot below:
But when I try to run an npm command from the interactive window I get a "SyntaxError: Unexpected identifier" error like the screenshot below:
So my question is – Why do I get a "SyntaxError: Unexpected identifier" error?



