SyntaxError: Unexpected token 'export'

Viewed 5289

I installed appium-doctor npm install -g appium-doctor. I then tried to run appium-doctor --android to see any missing dependencies for android. However, I got this error

.....\AppData\Roaming\nvm\v13.2.0\node_modules\appium-doctor\node_modules\uuid\dist\esm-browser\index.js:1
export { default as v1 } from './v1.js';

SyntaxError: Unexpected token 'export'
^^^^^^

From googling it's an issue with nodeJS using CommonJS instead of ES6 syntax, but I don't know how to solve this error on my command line.

2 Answers

I was running into the exact same error when I installed apollo-server. Node 14.5 solved it as Samuel mentioned.

Related