V
V
Vlad2019-03-31 13:59:43
JavaScript
Vlad, 2019-03-31 13:59:43

Why does import throw an error?

The code starts with:
import VK from "vk-io";
When I run the file I see this error:
(function (exports, require, module, __filename, __dirname) { import VK from "vk-io";
I am using d/node.js on Android
How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2019-03-31
@TRen208

import can only be used where it is supported, for example code up to babel
if this is not possible, require
example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question