Node version: v8.11.1
When using const something = require('lib) everything works fine. But when using import something from 'lib' it shows this:
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
I don't know what's wrong, or if I'm doing anything wrong :/
Thanks anyways for any help :)
Node version: v8.11.1
When using
const something = require('lib)everything works fine. But when usingimport something from 'lib'it shows this:I don't know what's wrong, or if I'm doing anything wrong :/
Thanks anyways for any help :)