SyntaxError: Cannot use import statement outside a module 错误展示: 中文意思就是:不能在模块外部使用import语句 解决方法 npm init -y初始化 package.json 配置文件 在package.json 配置文件中添加以下标记内容即可