SyntaxError: Cannot use import statement outside a module

SyntaxError: Cannot use import statement outside a module

错误展示:
在这里插入图片描述
中文意思就是:不能在模块外部使用import语句

解决方法

npm init -y初始化 package.json 配置文件

package.json 配置文件中添加以下标记内容即可
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_51441159/article/details/127893731
今日推荐