Home > Net >  "import * as fs from 'fs'" throws on node version v12.10.0
"import * as fs from 'fs'" throws on node version v12.10.0

Time:10-09

In node version v12.10.0 this line import * as fs from 'fs' throws

Thrown:
import * as fs from 'fs'
       ^

SyntaxError: Unexpected token *

CodePudding user response:

import support have been added n version 13.2

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility

12.10 is old and I recommend using 16.17.1 as it has long-term support

  • Related