在Node中的import语句上获取语法错误

时间:2019-07-28 01:29:49

标签: javascript node.js ecmascript-6

SyntaxError:意外令牌*

导入声明

import * as tst from ".//SCRIPT//CommonImport"

launch.json

{
    "type": "node",
    "request": "launch",
    "name": "Launch Current",
    "stopOnEntry": false,
    "cwd": "${workspaceFolder}",
    "outputCapture": "console",
    "program": "${workspaceFolder}\\${config:debug-current.file}",
    "autoAttachChildProcesses": true,
    "console": "integratedTerminal",
    "internalConsoleOptions": "openOnSessionStart"
}

1 个答案:

答案 0 :(得分:1)

我添加了

"runtimeArgs": [ "-r", "esm" ]

转到launch.json中的配置