Javascript 为什么es6中的导入在这里不起作用?

Javascript 为什么es6中的导入在这里不起作用?,javascript,node.js,Javascript,Node.js,这是我的密码 // var htmlplugin = require('html-webpack-plugin'); // works! import htmlplugin from 'html-webpack-plugin'; //not working 当我运行npm时,dev会显示如下错误: import htmlplugin from 'html-webpack-plugin' ^^^^^^ SyntaxError: Unexpected token import Node.js中

这是我的密码

// var htmlplugin = require('html-webpack-plugin'); // works!

import htmlplugin from 'html-webpack-plugin'; //not working
当我运行npm时,dev会显示如下错误:

import htmlplugin from 'html-webpack-plugin'
^^^^^^
SyntaxError: Unexpected token import
Node.js中尚不支持导入。Node.js使用Google的V8作为JavaScript引擎。Node.js当前附带的V8版本不支持导入。我认为即使是最新的V8也不支持没有命令行标志的情况


一旦支持导入,它可能仍然不支持通常由npm安装的CommonJS模块,尽管可能会,因为在互操作性方面有一些雄心勃勃的工作,时间会告诉我们的。

非常感谢您,很可能是重复的