Ich verstehe nicht, was falsch ist. Knoten v5.6.0 NPM v3.10.6Node.js - SyntaxError: Unerwarteter Token-Import
Mein Code:
(function (exports, require, module, __filename, __dirname) { import express from 'express';
Fehler:
SyntaxError: Unexpected token import
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:140:18)
at node.js:1001:3
Verwenden Transpiler es2015 wie Babel Import in NodeJS zu verwenden, da es nicht nativ in nodejs.There unterstützt wird, ist beste Alternative von Import ist damit so gehen müssen. –