npm init -y初始化文件夹npm install --global babel -cli 安装babel工具写文件npm install --save-dev babel -preset-es2015 安装es2015转码器使用命令进行转码 分为按文件转码和按文件夹转码