node.js - How to use "import" in nodejs v6.11.3 -


this question has answer here:

i want use "import" in nodejs + express app.

i know nodejs v6 support es6.

but can't use "import" in nodejs app.

node give me message. => syntaxerror: unexpected token import

what can es6.

node.js 6 not support esmodules, commonjs modules. can still use esmodules need install babel , transpile code.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -