Node.js: SyntaxError: Cannot use import statement outside a module
https://stackoverflow.com/questions/62488898/node-js-syntaxerror-cannot-use-import-statement-outside-a-module
WebJun 20, 2020 · SyntaxError: Cannot use import statement outside a module. – blex. Jun 20, 2020 at 17:00. @gautam1168 v12.16.2. – Serket. Jun 20, 2020 at 17:01. 11 Answers. Sorted by: 180. In order to use the import syntax (ESModules), you need to add the following to your package.json at the top level:
DA: 75 PA: 74 MOZ Rank: 75